开云体育

ctrl + shift + ? for shortcuts
© 2025 开云体育

VC++ SocketClient: Bug in connect?"


Todd_A_Turner
 

Hi all,

I have seen this problem in both my code, and in the testsocketclient
program.

If I call eConnect once, and it fails, the next time I call it, an
exception is thrown.

Anybody know how the connection process is supposed to work? (ie do
I need to create a new ewrapper and esocketclient each time I try to
connect, or can I reuse?)

thanks


 

eWrapper / eSocketClient is called once. Connect / Disconnect can be called multiple times.

Why does?eConnect fail ?. If it does fail, then errno is probably set to some error and needs to be cleared, or your code is setting it somewhere else and not handling it?(ie a string formatting issue). It's a good idea to constantly check errno before and after Tws calls and clear it.