• Post Reply Bookmark Topic Watch Topic
  • New Topic

A problem of "ServerSocket" on Linux  RSS feed

 
Hogan Wang
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I created a server class with ServerSocket, and run it on Linux (in daemon), however, when the Linux is rebooted, the client side could not feel it. It is still pending at "read" method instead of -1 returned from the method. It works when it is not run in daemon. Why?
 
Ernest Friedman-Hill
author and iconoclast
Sheriff
Posts: 24217
38
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Welcome to JavaRanch!

I'm not sure what running "in daemon" means -- automatically? Via inetd? In the background?

You can use "telnet" on the Linux machine to talk directly to your server program; that might be a good way to debug this:

telnet localhost port

(where port is the port number you are trying to run the server on.) Does this connect? Does it respond the way you expect if you type something? Until this works, you're obviously not going to be able to use the Java client.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!