Click here to Skip to main content
15,881,757 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi everyone!
Can anybody tell me how to use sfml socket in win32 kind of application, actually i can do it myself but the problem is that when i call accept() function the program get stuck until someone connects to it, which something really unaccetable so i was wondering if somebody could tell me how to make it work, i mean if there is a function like WSAAsyncSelect() function which is for windows socket, is there any similar function for sfml socket too.
thanks in advance.
Posted

1 solution

There is an alternative, there are threads, my friend.
 
Share this answer
 
Comments
Member 11593571 24-Jun-15 6:19am    
i didn't understand you, what do you mean.
CPallini 24-Jun-15 6:44am    
If you put the accept() call in a separate thread then your program (that is your main thread) won't get stuck.
Member 11593571 24-Jun-15 7:36am    
you mean calling accept() in the main function, right
CPallini 24-Jun-15 7:43am    
Nope, I meant in the main thread. Have a look at this page:
https://msdn.microsoft.com/en-us/library/y6h8hye8.aspx
Member 11593571 24-Jun-15 9:31am    
can you tell me how to do this

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900