I have 4 ServerSockets running at say port 1,2 ,3 4
A ServerSocket at port 1 listens for incoming connection from different clients and read from and write to clients. A socket connection can be created at any ServerSocket to write at other ServerSocket
Main class x creates serversocket and passes it to
thread and waits for client connection and if got any , processes it. Along with this at same while(true){}loop next to it in class x also executes.Both should work simultaneously
When I run it, I get some problems
1. After a while I get Connection refused exception/// like it works for say 1 min and starts throwing exception
2. while true() loop is also continously writing to ServerSocket at say port 2. Output at port 2 becomes..print java..print
java..
but i want it work like print
jsp print java print jsp print java