need to create a connection with router in Java Studio 8.1

I've allowed access for this port for example, 34567 for my router, and established a server/client, using J2SE 8.1; breakpoint at "waitForconnection" at Server class works and does what its supposed to do until it reaches this "connection" in client class and they can't talk to each other -both server & client have "clientTest/serverTest" classes

What am I doing wrong and can someone with some experience with setting up a router and a programmer assist me?

Please see below!

[code]

//setup server

public void runServer()

{

try // set up server to receive connections; process connections

{

server = new ServerSocket( 34567, 10 ); // create ServerSocket

while ( true )

{

try

{

waitForConnection(); // wait for a connection

getStreams(); // get input & output streams

processConnection(); // process connection

} // end try

catch ( EOFException eofException )

{

displayMessage( "\nServer terminated connection" );

} // end catch

finally

{

closeConnection(); // close connection

counter++;

} // end finally

} // end while

} // end try

catch ( IOException ioException )

{

ioException.printStackTrace();

} // end catch

} // end method runServer

//connect to server and process messages from the server

public class ClientTest

{

public static void main( String args[] )

{

Client application; // declare client application

// if no command line args

if ( args.length == 0 )

application = new Client( "123.45.67.8" ); // connect to localhost

else

application = new Client( args[ 0 ] ); // use args to connect

application.setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE );

application.runClient(); // run client application

} // end main

} // end class ClientTest[code]

[1983 byte] By [Deacon_44a] at [2007-11-27 11:19:54]
# 1

don't forget the backslash in the last code box:

[/code]

petes1234a at 2007-7-29 14:39:25 > top of Java-index,Java Essentials,New To Java...
# 2

You need to open up that port on the router.

Example (linksys wireless router):

Go to your web browser, and enter the IP for the router, usually something like:

192.168.1.1 or 192.168.0.1

Enter your credentials for access.

One of the multiple tabs will reference port forwarding or applications/gaming ... something along those lines. Go to that tab/section and open up your port. (Often times they ask for a range. If you want to open up a single port, make that single port the start port and ending port.) You'll also have to specify which IP on the router to direct requests on that port. For example, if you have three computers whose IP addresses are:

192.168.1.101

192.168.1.102

and

192.168.1.103

and you want access to go to the first computer, make sure that you specify the correct IP on your router ...

Good luck!

Navy_Codera at 2007-7-29 14:39:25 > top of Java-index,Java Essentials,New To Java...