and I try to new a socket class
but I don't know why the port number will become zero
can somebody help me, please?
Using java Syntax Highlighting
- try{
- this.socket=new Socket();
- this.socket.connect(new InetSocketAddress((this.host), Integer.parseInt(this.port)));
- print(socket.toString());
- print(Integer.toString(socket.getPort()));
- this.input=new Scanner(this.socket.getInputStream());
- this.output=new Formatter(this.socket.getOutputStream());
- this.output.flush();
- }
- catch(Exception e){
- e.printStackTrace();
- }
Parsed in 0.032 seconds, using GeSHi 1.0.8.4

