Advertisement

closesocket() an async socket after using sendto()

Started by April 26, 2015 03:25 AM
2 comments, last by hplus0603 9 years, 7 months ago

using UDP

The other PC will not recv this sendto because I called closesocket after.

is there any way to make the other PC recv this sendto?

appart from using sleep() between sendto and closesocket...

Look at the shutdown() call.
enum Bool { True, False, FileNotFound };
Advertisement

what I really want to do is stop recvs and sento in a socket if I press a button(shutdown()) but

If i press the button again I want to enable recvs and sento again

for this is WSAAsyncSelect() what I have to use?

If that's what you want, I would keep receiving data, and just discard it if I'm in the "ignore" state.
enum Bool { True, False, FileNotFound };

This topic is closed to new replies.

Advertisement