Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / .NET SDK / October 2003

Tip: Looking for answers? Try searching our database.

Private IP Addresses

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
JimSchacht - 21 Oct 2003 18:56 GMT
OKI, i'm pretty new to the whole network programming thing but i'm very
familiar with the framework. that being said, how do i go about creating a
TCP with a computer on a different network. i can create tcp connections on
machines within my olocal network with no problems either by DNS name or ip
address but as soon as i try to connect to a remote machine my program
cannot find them. this needs to be a tcp connection as apposed to http.
Ron Alberda [MSFT] - 21 Oct 2003 23:12 GMT
If you can ping the machine you should be able to connect to it using the
.Net Framework. Just do a Dns.Resolve.

C# sample that connects to the HTTP port of a server:

IPHostEntry serverHE = Dns.Resolve("servername");
IPEndPoint serverIP = new IPEndPoint(serverHE.AddressList[0], 80);

Socket client = new Socket(serverIP.AddressFamily, SocketType.Stream,
ProtocolType.Tcp);
client.Connect(serverIP);

-Ron

> OKI, i'm pretty new to the whole network programming thing but i'm very
> familiar with the framework. that being said, how do i go about creating a
> TCP with a computer on a different network. i can create tcp connections on
> machines within my olocal network with no problems either by DNS name or ip
> address but as soon as i try to connect to a remote machine my program
> cannot find them. this needs to be a tcp connection as apposed to http.

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.