Socket bind failed on the second binding
Hi all,
I have the problem about the socket. This socket set some parameters from SSL. It worked fine for the first time binding. Then, I restarted the application, and the socket cannot bind anymore and throw an errno 142.
When running it on FP1 device, it works perfectly. But on FP2 device (E72), it failed on the second binding even though I restarted the application. E72 device is using the latest firmware. Is this the FP2 device problem?
Below is the brief of my code:
Initialize and binding code
[CODE]
m_socket = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP);
...
if(bind(m_socket, (struct sockaddr*)&bindaddr, sizeof(bindaddr)) < 0)
{
// Print the errno;
}
...
while (connect(m_socket, (struct sockaddr*)&sockaddr, sizeof(struct sockaddr_in)) < 0) {
// return if error;
}
[/CODE]
Release code
[CODE]
shutdown(m_socket, 2);
close(m_socket);
[/CODE]
I have been stuck in this for a long time. Please help me.
Thanks a lot
Re: Socket bind failed on the second binding
we have a similar problem and it started with new E72 firmware released last year. The problem is also on newer E5 firmware (also FP2).