Hi !
Featured games (91)
games approved by the League of Dukes
Games in Showcase (757)
Games in Android Showcase (229)
games submitted by our members
Games in WIP (844)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  tcp chat program, I don't like that i have to set up my router to forward ports  (Read 2300 times)
0 Members and 1 Guest are viewing this topic.
Offline wilburthemexican

Senior Newbie

« Posted 2008-02-11 23:12:24 »

i'm trying to right a tcp chat program i have it set up so that you can choos to be either the server or the client
the server is set up like this:

 ServerSocket srvr = new ServerSocket(port);
 Socket skt = srvr.accept();

and the client is set up like this:

Socket skt = new Socket(ipAdress,port);

It works running both on one computer using port 12345 and ip "localhost", and it works over internet using port 12345 and my public ip. But for it to work  over the internet i had to set up my router to forward port 12345 to my computer running the server.
how do i make it so that the program opens up a user defined port and forwards it to the server computer, so that users of the program only have to know the public ip of the server and the port. I don't know if that's how its supposed to work but that was what i was thinking. Thanks.
Offline ryanm

Senior Devvie

Projects: 1
Exp: 15 years

Used to be bleb

« Reply #1 - Posted 2008-02-11 23:59:31 »

What you want is called "UPnP". It's a technology that most routers implement that allows applications to open ports and forward traffic automatically.

Google should be able to turn up Java implementations.
Offline noblemaster

« JGO Spiffy Duke »

Medals: 35
Projects: 11

Age of Conquest makes your day!

« Reply #2 - Posted 2008-02-12 20:58:16 »

In regards to UPnP, I found this:

You can use it to configure your router to redirect traffic. Does anyone have experience using UPnP? It sounds really cool, but I wonder (a) how well it works and (b) how many routers actually support it?

If anyone is interested, I write a small test program to see how well that works (you folks would have to run it though)?

Pages: [1]
  ignore  |  Print  

EgonOlsen (77 views)
2018-06-10 19:43:48

EgonOlsen (57 views)
2018-06-10 19:43:44

EgonOlsen (77 views)
2018-06-10 19:43:20

DesertCoockie (259 views)
2018-05-13 18:23:11

nelsongames (157 views)
2018-04-24 18:15:36

nelsongames (156 views)
2018-04-24 18:14:32

ivj94 (897 views)
2018-03-24 14:47:39

ivj94 (161 views)
2018-03-24 14:46:31

ivj94 (810 views)
2018-03-24 14:43:53

Solater (174 views)
2018-03-17 05:04:08
Java Gaming Resources
by philfrei
2017-12-05 19:38:37

Java Gaming Resources
by philfrei
2017-12-05 19:37:39

Java Gaming Resources
by philfrei
2017-12-05 19:36:10

Java Gaming Resources
by philfrei
2017-12-05 19:33:10

List of Learning Resources
by elect
2017-03-13 14:05:44

List of Learning Resources
by elect
2017-03-13 14:04:45

SF/X Libraries
by philfrei
2017-03-02 08:45:19

SF/X Libraries
by philfrei
2017-03-02 08:44:05 is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!