lgnr
Joined: 17 Dec 2009 Posts: 39
|
Posted: Wed Jul 07, 2010 5:05 am Post subject: Crazy delay before socket is ready |
|
|
So i have a loop like this inside a thread:
Code: |
while(running)
{
error = sendto(sock,message,sizeof_message, 0, (struct sockaddr *)&address, sizeof(address));
if(error < 0) printf("Error on sendto\n");
sleep(100000);
}
|
It outputs "Error on sendto" for about 3 minutes and then starts to send right.
Funny thing is: When it was inside main(), it did the same, except that it was for about only 20 seconds.
Any ideas?
Thanks in advance. |
|