Hello all,
I need to write a program in Java (or C++) that allows a server and client to talk with one another asynchronously. I need to be able to let the client send multiple messages in a row to the server. Then, I need the server to write back to the client as many times as it wants.
I have looked at a ton of webpages that talk about "Non-blocking I/O" for Java - which have given me some help. I've downloaded some example programs, and I've tried modifying them to do what I want, but nothing has worked so far. I've waded through all of the Java.nio man pages...
I've gotten the programs to write back and forth - taking turns. But this isn't what I want! I need the client to write a message to the server. Then I need to be able to send ANOTHER message to the server BEFORE getting a response back from the server. Something like this:
Client: Red
Client: Blue
Client: Green
Client: How are you?
Server: Fine.
Server: How are you?
Client: Great!
Does anyone have any idea how to make this happen? The code I've found online seems to be more complex than I want... Please help me!!!
I need to write a program in Java (or C++) that allows a server and client to talk with one another asynchronously. I need to be able to let the client send multiple messages in a row to the server. Then, I need the server to write back to the client as many times as it wants.
I have looked at a ton of webpages that talk about "Non-blocking I/O" for Java - which have given me some help. I've downloaded some example programs, and I've tried modifying them to do what I want, but nothing has worked so far. I've waded through all of the Java.nio man pages...
I've gotten the programs to write back and forth - taking turns. But this isn't what I want! I need the client to write a message to the server. Then I need to be able to send ANOTHER message to the server BEFORE getting a response back from the server. Something like this:
Client: Red
Client: Blue
Client: Green
Client: How are you?
Server: Fine.
Server: How are you?
Client: Great!
Does anyone have any idea how to make this happen? The code I've found online seems to be more complex than I want... Please help me!!!
