I have a blocking call to accept(). From another thread I close the socket, hoping that it'll unblock the accept() call, which it does but I have a case when it doesn't: e.g. thread A enters accept(), thread B closes the socket, thread A doesn't return from accept().
Question: what could cause closing a socket to not unblock an accept()...
Hello
I cannot use threads thus I want to write a server program that can be interrupted after a while:
d = show_non_modal_dialog("serving clients")
s = socket(...)
s.bind(...)
s.listen()
while (!user_pressed_cancel())
{
s.accept() # timed accept for like 1 second
if timed_out:
continue
serve_client
close_client_sock
}
hid...
Hey guys,
I am currently make a Server, I learned to make something like this:
while(true)
{
SOCKET s = accept(s, ....)
// do something with the connection
printf("connection\n");
}
I learned that it will stuck at accept(..) while there isnt a connection.
In my Program there isnt any connection yet, but it get overflo...
I have a server application that opens a socket and listen for a connection. In the application, I have a separate thread that creates a socket, binds it and calls the listen and accept functions on it.
When the application closes I call closesocket on the socket that was created, then wait for the socket thread to close. However, if...