TcpClient problem

D

Dirk Reske

Hello,

I try to connect to a remote server using TcpClient.BeginConnect(...);
after I call the BeginConnect method, the Callback is imedeately called,
but the socket isn't connected!
When I set a breakpoint at the callback, so that I have a little break...
the socket gets connected.
What can this be?

thx
 
J

Jianwei Sun

There are two types of calls : "Block" or "Non -Block", I believe you
are using the Non-block mode, so even the call back is immediately
called, it doesn't mean the connection is established.

You may want to try "Block " mode if you wish.

HTH
Jianwei
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top