Computing.Net > Forums > Programming > How to send tcp packets on internet

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

How to send tcp packets on internet

Reply to Message Icon

Name: ryt
Date: September 30, 2008 at 08:32:40 Pacific
OS: WinVista
CPU/Ram: 512mb
Product: 2400+
Comment:

I bilt a program so you can chat on network, but it only works over local network. In program you need to enter ip address and a port number. So I tried 192.168.1.2 and similar and it works.
But now I wonted to chat over internet. So I went to see what my internet ip address is, and its 89.201.183.44. I entered that address but an exeption is raised saying that socket cant bind to that address. So I dont know how to host over internet.
Over internet I found that my hostname is 89-201-183-44.dsl.optinet.hr. From here I found that my ip address is 89.201.183.44 (actualy thats my router ip address).
In my program I tried GetHostName() and I get my computer name not 89-201-183-44.dsl.optinet.hr.
Im using .NET 3.5



Sponsored Link
Ads by Google

Response Number 1
Name: klint
Date: September 30, 2008 at 09:28:24 Pacific
Reply:

Your router uses Network Address Translation (look it up on Google or Wikipedia.) You need to tell the router, if it offers that facility (check your router's manual), to set up "forwarding" - so that the server software on your PC binds a socket to your local IP address of 192.168.1.2 but the client software (on another computer on the Internet) connects to 89.201.183.44 (by the way, this address is likely to be different every time you connect to the Internet) and your router forwards the packets to your computer.


0
Reply to Message Icon

Related Posts

See More


visual C++ Open batch in new window ...



Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: How to send tcp packets on internet

how to send data client(c++) to server(c#) www.computing.net/answers/programming/how-to-send-data-clientc-to-serverc/20139.html

How to do: Net Send Batch File www.computing.net/answers/programming/how-to-do-net-send-batch-file/18083.html

How to put Excel spreadsheet on web pag www.computing.net/answers/programming/how-to-put-excel-spreadsheet-on-web-pag/1845.html