|
From: | Mathias Zenger |
Subject: | AW: [lwip-users] Re: More help with socket |
Date: | Wed, 9 Sep 2009 08:15:37 +0200 |
-----Ursprüngliche Nachricht-----The second part is not correct because always my task have the control and another task never enter.
Von: address@hidden [mailto:address@hiddenIm Auftrag von Oscar F
Gesendet: Dienstag, 8. September 2009 20:12
An: Mailing list for lwIP users
Betreff: [lwip-users] Re: More help with socket
can i use the select option? with TCP connection and another idea to listen about three socket and blocking while there isn´t data?
Thanks again
Oscar
On Tue, Sep 8, 2009 at 7:59 PM, Oscar F <address@hidden> wrote:
I know more data about the application. The connection is TCP, and i have to open 6 socket, all of them unidirectional , 3 for request and 3 for response.
Logical links connection sequence
logical links connection process shall be initiated by the PC unit: it will connect sequentially (one after the other) all the logical links.
At power-on/reset, the EVK1100 application shall first create the sockets in order to be ready for accepting a connection in all of them.
my first question is the function accept is blocking the code, because i´ll do of this way
-createsockets( ) (the six socket)
-bind( ) the six socket
-listen ( ) the six socket
and then
do {
-accept ( ) for socket one
if the answer is OK
-accept () for the second one
if the answer is OK
...
-accept () for the six one
if the answer is OK then fin=true
}while (fin)
is that correct?
the next step is listen for 3 socket to request and this is my idea:
do{
if recv(socke1)
{
//process
}
if recv(socket2)
{
//process
}
if recv(socket3)
{
//process
}
}while (fin2)
is a good idea?
thanks for all
Oscar
[Prev in Thread] | Current Thread | [Next in Thread] |