Make sure you are not using a println() to write out your commands
since the "ln" part is platform dependent and typically not CRLF which
is probably not what telnet is looking for. Instead, use:
String CRLF = "\r\n";
String command = "telnet_command";
PrintWriter writer = new PrintWriter(socket.getOutputStream());
writer.write(command);
writer.write(CRLF);
writer.flush(); // flush the buffer!
-Gary
Greg Walker wrote:
>
> I am having a problem with a server written in java that uses sockets.
> The server runs fine; the problem arises when I try to access it. The
> client is simply telnet and after making a connection, and receiving a
> handful of bytes, the client hangs as if the server is not responding.
> Yet the server seems to be fine because I can establish another
> connection to it.
>
> This problem goes away if I use the java -debug option (which
> incidentally throws an exception) or run the server with jdb.
>
> I am using jdk1.1.7b and RedHat 6.0 (kernel 2.2.5-15). There was a rumor
> that java 1.1.6 had a bug with sockets which was fixed in 1.1.7, but I
> can't locate the docs and I still seem to have a problem.
>
> On additional note, ... the server ran fine while I was using a dynamic
> DHCP address. Once my provider switched me to a static IP address, this
> problem appeared. Any ideas ?
>
> Thanks,
> --
> Greg Walker
> [EMAIL PROTECTED]
>
> ----------------------------------------------------------------------
> To UNSUBSCRIBE, email to [EMAIL PROTECTED]
> with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]
--
-Gary
----------------------------------------------------------------------
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]