R
Richard Maher
Hi,
Sorry if this is another stupid question, but it's been a long day and I'm
trying to rule things out.
I've got a tcp/ip Socket connected to a remote host. I've also got a Reader
thread with a blocking read on a BufferedInputStream associated with that
Socket. In another thread, I then do a write to a BufferedOutputStream
associated with the same Socket.
What I think I'm seeing is the local buffered-read pick up the message
rather than the remote host. Clearly a bug somewhere in my code, but not
being the full-bottle in the ins and outs of Java
BufferedInput/OutputStreams I'd appreciate it if someone could rule out any
missing switch or config/constructor issues.
1) I create a Socket
2) in = new BufferedInputStream(sock.getInputStream(), maxbuf)
3) out = new BufferedOutputStream(sock.getOutputStream(), maxbuf)
4) Exchange a couple of messges happily with remote host
5) Kick-off a Reader thread that does and in.read
6) Send off a message to the remote-server which looks like it's being
nabbed by 5
Cheers Richard Maher
Sorry if this is another stupid question, but it's been a long day and I'm
trying to rule things out.
I've got a tcp/ip Socket connected to a remote host. I've also got a Reader
thread with a blocking read on a BufferedInputStream associated with that
Socket. In another thread, I then do a write to a BufferedOutputStream
associated with the same Socket.
What I think I'm seeing is the local buffered-read pick up the message
rather than the remote host. Clearly a bug somewhere in my code, but not
being the full-bottle in the ins and outs of Java
BufferedInput/OutputStreams I'd appreciate it if someone could rule out any
missing switch or config/constructor issues.
1) I create a Socket
2) in = new BufferedInputStream(sock.getInputStream(), maxbuf)
3) out = new BufferedOutputStream(sock.getOutputStream(), maxbuf)
4) Exchange a couple of messges happily with remote host
5) Kick-off a Reader thread that does and in.read
6) Send off a message to the remote-server which looks like it's being
nabbed by 5
Cheers Richard Maher