A socket operation encountered a dead network

Hi,

I got that error when create the TcpClient for SmartClient. Code is really simple

TcpClient client = new TcpClient(hostname, port);

Note: It's ok if i create TcpClient object for normal windows application. What I notice is that it takes some time to get connected. It may be the problem for Smart Device application.

Thanks

WIROL

[381 byte] By [wirol] at [2008-1-9]
# 1
Anyone?
wirol at 2007-10-3 > top of Msdn Tech,Smart Device Development,Smart Devices General...
# 2

Hi WIROL,

From your information, I would suggest you try the following things:

1. Can you visit the hostname pc via IE, which looks like: \\hostname\

If you can't visit the hostname, maybe some network problem.

Please check it .

Best regards,

Guang-Ming Bian - MSFT

Guang-MingBian-MSFT at 2007-10-3 > top of Msdn Tech,Smart Device Development,Smart Devices General...
# 3

Hi,

I've already mentioned about that.

I CAN connect to that address with Windows App.

I CAN'T ONLY connect to that address in Mobile App.

I've already tested with both Device Emulator and real PDA.

Thanks

wirol at 2007-10-3 > top of Msdn Tech,Smart Device Development,Smart Devices General...
# 4

Hi WIROL,

Sorry for my unclear description, I would suggest that you vist the hostname pc from your device/emulator, not your pc

, you can follow the steps to test:

  1. New a IIS virtual folder(for example myDevice) and html file(for example a.htm) and publish to your device.
  2. You can use http://hostname/myDevice/a.htm link to test whether device can visit hostname pc.

If it can't visit hostname, you should do some setting in your device or emulator to let device to visit internet. this is has been discussed a lot in the forum. see below:

http://forums.microsoft.com/MSDN/Search/search.aspx?words=can%27t+connect+internet&searchKey=&lcid=1033&searchscope=forumgroupscope&siteid=1&ForumID=-1&ForumGroupID=11

Best regards,

Guang-Ming Bian - MSFT

Guang-MingBian-MSFT at 2007-10-3 > top of Msdn Tech,Smart Device Development,Smart Devices General...
# 5

Hi,

Actually, I want to connect to IRC server.

I've already developed PC application and it works well.

Then I created a dummy program for my Mobile and tested it. Then I got connection.

Later I created real application for Mobile and then tested. Then I got that Socket error.

But my mobile can connect to internet. I can view internet web pages and I can view workgroup computers.

Anyway, thanks for your reply

wirol

wirol at 2007-10-3 > top of Msdn Tech,Smart Device Development,Smart Devices General...
# 6

Hi wirol,

I have tried your code in my network, it works fine. I am confused about your problem. I think it must be something problem with your network. Please check whether your network or hostname PC has a firewall which may block some ports to pass it.

Best regards,

Guang-Ming Bian - MSFT

Guang-MingBian-MSFT at 2007-10-3 > top of Msdn Tech,Smart Device Development,Smart Devices General...