F
Fritz Bayer
Hello,
I'm playing around with the NIO api trying to figure out how certain
functions respond and work.
I know that SocketChannel.read() can return -1, which actually signals
a EOF. I have seen this and I'm trying to reproduce it
To do so I use telnet to connect to my server. Then I type "^]" so
enter the special mode of telnet and use "send eof" to sent an EOF to
the program.
I use a debugger to check out whats comming in. My
SocketChannel.read() returns two bytes -1 and -20 respectively. Those
correspond to the ISO 8859 latin1 of 255 and 236.
I was expecting that SocketChannel.read() would not fill the buffer
and return a -1 instead.
Now I was wondering if anybody has some suggestions on what I'm doing
wrong here?
I just thought that maybe the telnet program does not really send eof
but something else instead?
Typing in ^D does not work. This usually corresponds to EOF when using
bash under linux.
Fritz
I'm playing around with the NIO api trying to figure out how certain
functions respond and work.
I know that SocketChannel.read() can return -1, which actually signals
a EOF. I have seen this and I'm trying to reproduce it
To do so I use telnet to connect to my server. Then I type "^]" so
enter the special mode of telnet and use "send eof" to sent an EOF to
the program.
I use a debugger to check out whats comming in. My
SocketChannel.read() returns two bytes -1 and -20 respectively. Those
correspond to the ISO 8859 latin1 of 255 and 236.
I was expecting that SocketChannel.read() would not fill the buffer
and return a -1 instead.
Now I was wondering if anybody has some suggestions on what I'm doing
wrong here?
I just thought that maybe the telnet program does not really send eof
but something else instead?
Typing in ^D does not work. This usually corresponds to EOF when using
bash under linux.
Fritz