why does the tcpclient.connect always return true on my handheld?

G

Guest

hi, all

I have a piece of code like this:
bool bRet = true;
try
{
System.Net.Sockets.TcpClient client = new TcpClient();

client.Connect(new System.Net.IPEndPoint(IPAddress.Parse(strIP),8000));

client.Close();
}
catch(Exception ex)
{
bRet = false;
}
I tested this code on my hp 5150, whatever the strIP is, except empty, the
connect() always return very quickly and looks like it connected
successfully. But this is not ture. Does anyone know what is wrong here?
Thanks
 
P

Paul G. Tobey [eMVP]

At a guess, because you are connected to the 'network' via ActiveSync.
Remember that this simulated network connection may not perfectly match what
you'd expect from a 'real' network connection (because ActiveSync isn't
perfect ;-)

Paul T.
 
G

Guest

Thank you pual.
You are right. I test it with a ethernet card without activesync connecting.
It works great.
 

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