31
Network / Problem with TCP server/client [v1.6]
« on: August 01, 2011, 05:53:27 pm »Quote from: "Laurent"
Quotei noticed that when i use connect if there is no connection possible it returns so the application terminates. So i wrap it in this loop to check if the connection is sucessfull step out and send data etc etc.
You're calling Connect twice per iteration, so the first one is always ignored. And you're looping while it returns Disconnected, but it could as well return Error or NotReady.
but even without the loop it returns.
I'm messing with networking for quite some time now, but i always end up in dead-ends and it's really annoying. I am working with Winsock too, very well documented but extremely complicated. SFML network is easier than Winsock but i don't really see light. The thing is that i am working with c++ for 4 years and never stuck into something for such a long time. I think i may need to look for a general network programming tutorial. If you have any tips they are welcome... :?