lwip-users
[Top][All Lists]
Advanced

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

Re: [lwip-users] UDP socket receive


From: Gisle Vanem
Subject: Re: [lwip-users] UDP socket receive
Date: Wed, 30 Jan 2013 13:22:36 +0100

"Gisle Vanem" <address@hidden> wrote:

addr.sin_len=sizeof(addr);
addr.sin_family=AF_INET;
addr.sin_port=PP_HTONS(MyPort);
addr.sin_addr.s_addr=PP_HTONL(INADDR_ANY);
s=socket(AF_INET, SOCK_DGRAM, 0);
ret=connect(s, (struct sockaddr*)&addr, sizeof(addr));

ret=read(s, buffer, size);

The calls are all successful, read is waiting. I can see the udp frame coming
in with the right port. However the frame is discarded in udp_input:

You'll have to add a call to bind(). Something like:

Forgot to say; drop the connect(). Use bind() between the socket() and
the read().

--gv



reply via email to

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