lwip-users
[Top][All Lists]
Advanced

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

Re: [lwip-users] Can not receive data by recv() or netconn_recv()


From: Gisle Vanem
Subject: Re: [lwip-users] Can not receive data by recv() or netconn_recv()
Date: Fri, 01 Mar 2013 15:24:10 +0100

"garypty" <address@hidden> wrote:

send (my_socket, message, strlen(message), 0);          // Send out a
request message
recv (my_socket, recv_buffer, sizeof(recv_buffer), 0);           // Blocked
the thread for receiving a respond
debug_flag++;
// start microphone and speaker here.../

I use Wireshark to sniff the traffic. My device did send out a request
message (an INVITE message in SIP) and the other end did respond a message
(a 180 RINGING respond) and my device did reply an ACK for that response.
However I found that the "/debug_flag/" did not increment and the thread is
still blocked.

Why shouldn't it? The little I know about SIP, is it that it can use both UDP
and TCP. I assume you use UDP, or?

So how do your protocol receiver-function know when a complete response has been completed? I assume you'll have to wait until a CRLF is received. You could try calling 'recv (s,&ch,1)' in a loop and decode the response char-by-char until you see a CR-LF combination. Or maybe lwIP does have
a fgets() for sockets?

--gv



reply via email to

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