News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

different behaviour on restart

Started by realcr, March 16, 2006, 08:58:40 AM

Previous topic - Next topic

realcr

Hi everyone.

I was following IcZelion's tutorials for socket programming and some other books but strange things happen in my programs.
I wrote a really simple client and server programs , and I make them work at this order:
1. Connect server.
2. Connect client (A connection is reported).
3. Disconnect client
4. Disconnect server.
5. Connect server.
6. Connect client. (now there is no connection of some strange reason).

I can't understand why doesn't it work in the second time. if I close the programs and reopen them it will work , but If I just push invoke a close socket call and then try again it won't work. I was told to use some flag called SOCKET REUSE or something similar but it didn't change much.

It might not be directly related to masm but I just hoped someone knows how to fix it.
Thanks,
realcr.

realcr

I can't believe I found the problem after such a long time looking for it...
I tried using closesocket instead of close and now it works.
This is really strange ,as I was sure both of these functions had the same implementation under windows. (At least in linux it worked that way).

realcr.