Winsock states - help needed!
hi guyz,
i need somone to help xplain to me all the winsock states
i only know the sckClosed - 0, sckConnected and sckError but am suprised when i started seein some numerical value like 8
and i want to know all the winsock states we have what can you actually do with winsock when in this states.
assuming i entered the wrong server ip from the client app in design time and there's a form i've created where you can specify a new server ip in runtime.
ok now i run my app and i want to change the ip at runtime and re-connect the winsock. how can i do it
i've been trying this and it gives error each time saying "wrong protocol or connection state"
help plz
Re: Winsock states - help needed!
sckClosed 0 Default. Closed
sckOpen 1 Open
sckListening 2 Listening
sckConnected 7 Connected
sckError 9 Error
this is what i found in the msdn library
Re: Winsock states - help needed!
and before you can change the ip, or connect it again, try to close it first!
listen example:
VB Code:
winsock1.close
winsock1.localport 555
winsock1.listen
connect example:
VB Code:
winsock1.close
winsock1.connect "www.microsoft.com", 80
this should do it... it just have to be closed before you can modify it's settings!
Re: Winsock states - help needed!
Re: Winsock states - help needed!
but this means you can't use the same port that it's using before it was closed
it brings up the message "Address is in use"