Re: SocketChannel.write(ByteBuffer src) problem
- From: technodolt <technodolt@xxxxxxxxx>
- Date: Sat, 24 May 2008 03:58:17 -0700 (PDT)
On May 24, 3:45 am, Daniele Futtorovic <da.futt.n...@xxxxxxxxxxxxxxx>
wrote:
On 2008-05-24 12:27 +0100, technodolt allegedly wrote:
Nope. Using getKeyCode().
And what are you doing with that value?
if(e.getKeyCode() == KeyEvent.VK_ENTER)
I'm using a class that extends KeyAdapter. I can literally change
As I said, it works fine when using keyReleased, it just doesn't work
when using keyPressed.
With the /exact/ same data?
ONLY the name of the method I'm overriding, leaving all other code
completely, 100% identical, and use the exact same data to send, and
it works with keyReleased, and not with keyPressed.
I can't use KeyTyped/getKeyChar because I'm processing on enter...If I was using getKeyChar(), it wouldn't work for either of them.
If your problem persists, wouldn't it be worth your while to consider
using getKeyChar() on KEY_TYPED events?
doesn't have an associated character, and therefore can only be caugh
with Released/Pressed.
Not a problem. I spent an hour plus trying to debug this earlier andAnd it still recognizes the key press... other code inside the
listener still fires off when you hit enter. The only line that
isn't working is the SocketChannel.write call. It doesn't throw any
exceptions, it returns the correct value as though it were writing,
the value is just never actually sent through the socket.
a) I'm also pulling the exact same data into a byte array and then
using a message dialog to show me a string created from that byte
array. b) With the telnet server I'm using, if it sent anything _at
all_, I would get a response back. I'm getting no response, and then
getting my connection dropped due to inactivity.
All this put together sounds very odd, and as such rather unlikely -- if
you'll forgive the scepticism.
going "This just doesn't make ANY sense", so I had a healthy dose of
skepticism myself. I finally thought it would be better to get
outside input than keep poking at it, in case I'm missing something
obvious.
--
DF.
to reply privately, change the top-level domain
in the FROM address from "invalid" to "net"
.
- Follow-Ups:
- Re: SocketChannel.write(ByteBuffer src) problem
- From: Daniele Futtorovic
- Re: SocketChannel.write(ByteBuffer src) problem
- References:
- SocketChannel.write(ByteBuffer src) problem
- From: technodolt
- Re: SocketChannel.write(ByteBuffer src) problem
- From: Daniele Futtorovic
- Re: SocketChannel.write(ByteBuffer src) problem
- From: technodolt
- Re: SocketChannel.write(ByteBuffer src) problem
- From: Daniele Futtorovic
- SocketChannel.write(ByteBuffer src) problem
- Prev by Date: Re: SocketChannel.write(ByteBuffer src) problem
- Next by Date: Re: SocketChannel.write(ByteBuffer src) problem
- Previous by thread: Re: SocketChannel.write(ByteBuffer src) problem
- Next by thread: Re: SocketChannel.write(ByteBuffer src) problem
- Index(es):
Relevant Pages
|