c# - ASP.NET TcpClient intranet -


i'm developing application in asp.net using visual basic, have connect server in private network. application must working network (in future can work on internet, too), have problem tcpclient on asp.net: if connect server using instance of ipaddress

client = new tcpclient client.connect(new ipaddress("192.168.1.12"), 6001) 

the socket try connect 176.64.116.11 (that's not public ip address...), else, if connect server string contains local ip address

client = new tcpclient client.connect("192.168.1.12", 6001) 

the socket connects succesfully nothing responds command (with networkstream.write , read) try of these in windows application , work succesfully.

thanks (i made mistake in english? ahaha, sorry :d)

ps. if post me code in c# don't worry, can translate it

tcpclient has various overloads, can give string containing ip address or ipaddress object.

also, use

ipaddress ipaddress = ipaddress.parse("192.168.1.12"); 

ipaddress not contain constructor takes string.

http://msdn.microsoft.com/en-us/library/system.net.sockets.tcpclient.connect.aspx

as transmission issue; disable firewalls. try localhost first.


Comments

Popular posts from this blog

c++ - Creating new partition disk winapi -

Android Prevent Bluetooth Pairing Dialog -

php - joomla get content in onBeforeCompileHead function -