lwip-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lwip-users] Help,V1.3.2,socket API, how to deal with multi client?


From: Kieran Mansley
Subject: Re: [lwip-users] Help,V1.3.2,socket API, how to deal with multi client?
Date: Mon, 28 Mar 2011 12:47:00 +0100

On Mon, 2011-03-28 at 04:36 -0700, megatron wrote:
> method:
> 1. listen(iSock,0),but is doesn't work.still more than one client can 
> 
> connected.
> 2. closesocket(tsock) after send().But after several times the
> closesocket 
> 
> funcion doesn't return.

I think this problem was raised a few months ago by someone else, so you
might want to search through the mailing list archives.

Method (1) doesn't work because of the way the backlog parameter is
handled internally.  I think 0 was used as a special value to mean "no
backlog enforced" rather than "don't allow any connections to be
queued".  I think this has been changed in the current code, but I'm
working from memory so could be wrong.

I don't understand how method (2) would work.  Why would closing tsock
affect the listening socket (isock)?


> How can I do with this situation that there are more than one
> client?  

Try closing the listening socket after you've accepted the connection
you want, then re-creating the listening socket when you're ready to
listen again.

Kieran




reply via email to

[Prev in Thread] Current Thread [Next in Thread]