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]

