java - Threads & networking issue -
given following code: client c1 = new client(); c1.connect("127.0.0.1",1300); connect function: public void connect(string servername, int port) { try { socket socket = new socket(servername,port); connection = new connectionproxy(socket); connection.start(); } catch(ioexception e) { e.printstacktrace(); } } ( connectionproxy class extends thread ) : public class connectionproxy extends thread { private socket socket; private inputstream is; private outputstream os; private stringconsumer client; public connectionproxy(socket socket) { this.socket = socket; try { = socket.getinputstream(); os = socket.getoutputstream(); } catch(ioexception e) { e.printstacktrace(); } } public void run () { datainputstream dis = new datainputstream(is); dataoutputstream dos = new dataoutputstream(os); while (socket != null) { try { string...