Hi, does anyone have any experience with using the SetSockOpt() function when using CSocket/CAsyncSocket ???
Here's my problem: I've successfully got a client and server to talk to each other (yay!). However, say I log off the client and then try to reconnect, I just get an error saying that the address is already in use!
I have to manually disconnect from internet and reconnect before it will work again.
From what I understand (and I could be wrong) I need to use the CAsyncSocket::SetSockOpt() function to pass SO_REUSEADDR to the socket to cure this problem.
However, this presents yet another problem: I think I'm supposed to call this function BEFORE the socket is bound to the address. However, I can't because Bind() is called during creation!
Does anyone know how I can cure this reusing address problem? Thanks
Here's my problem: I've successfully got a client and server to talk to each other (yay!). However, say I log off the client and then try to reconnect, I just get an error saying that the address is already in use!
I have to manually disconnect from internet and reconnect before it will work again.
From what I understand (and I could be wrong) I need to use the CAsyncSocket::SetSockOpt() function to pass SO_REUSEADDR to the socket to cure this problem.
However, this presents yet another problem: I think I'm supposed to call this function BEFORE the socket is bound to the address. However, I can't because Bind() is called during creation!
Does anyone know how I can cure this reusing address problem? Thanks