File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

can someone explain me? (ServerSocket)

 
Julio Cesar Marques
Ranch Hand
Posts: 80
BSD Java
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ServerSocket theServer = new ServerSocket(port);
Socket client = theServer.accept();
/**
*
client.getInputStream() EXISTS!
client.getOutputStream() EXISTS!
*
*/

new Thread(HndSock(client)).start();
--> Inner Thread...
/**
*
client.getInputStream() IS NULL!
client.getOutputStream() IS NULL!
*
*/

Why? I Like to understand whats happens?
Why the Object client inner the thread is not null BUT your streams are?
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic