console reading and writing to a socket

?

-

i have a class that listens to and sends messages from and to a socket.
it's console based and when i run it on eclipse i can only see the
system.out.println(..) of the messages received.

i know the solution if it's gui based but in this case, what should i do
to have a way to input the data while at the same time reading what is
received. can an IDE do that?
 
G

Gordon Beaton

i have a class that listens to and sends messages from and to a
socket. it's console based and when i run it on eclipse i can only
see the system.out.println(..) of the messages received.

i know the solution if it's gui based but in this case, what should
i do to have a way to input the data while at the same time reading
what is received. can an IDE do that?

You can:

- use separate threads for console and socket IO

or

- use a java.nio Selector, which lets you multplex IO from several
sources using a single thread

/gordon
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,756
Messages
2,569,533
Members
45,007
Latest member
OrderFitnessKetoCapsules

Latest Threads

Top