On Mon, 14 Sep 2009, WenSheng wrote:

Hi,

>   I test netio function,
>   at server side use:
>   -------------------
>    pListenSocket := NETIO_LISTEN( PORT, IP, DRIVER )
>    do while .t.
>       pConnectionSocket := NETIO_ACCEPT( pListenSocket )
>       ? 'Have one connect...', pConnectionSocket
>       NETIO_SERVER( pConnectionSocket )
>    enddo
>   -------------------
> I'm use 'netio_server' to create connect, 
> but, I don't know how to stop server connect when client is close connect!!

It's stopped automatically when client close all connections to
given server or when last copy of connection socket is cleared.
All allocated resorces are released when last copy of connection
socket is cleared. BTW you should add to above code:
      pConnectionSocket := NIL
just after:
      NETIO_SERVER( pConnectionSocket )
if you want to force releasing the resources bound with pConnectionSocket.
Otherwise they are release when new connection is accepted and
pConnectionSocket is overwrite in line:
      pListenSocket := NETIO_LISTEN( PORT, IP, DRIVER )

> server side is add memory when client connect to server.
> no method to release memory when client connect is close.

I do not think that above is true. AFAIK all allocated resources are
cleanly released.

best regards,
Przemek
_______________________________________________
Harbour mailing list
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour

Reply via email to