Some questions about making IM p2p software

J

JTL.zheng

I want to make a IM(instand messager) , just point to point
and I have learned some lessions which tell me to do it by these:

waiting for a socket
build up a socket
get the input/output iostream
send message
while((str=in.readline())!=null){
print str
send your message
}
close all

but as you know,what it can do is:
send a message
waiting for a message
send another message
waiting for a message
send....
waiting for...

you must waiting for the message before you want to send a new message

so my question is how to make it to send a message arbitrary
not must to waiting for the coming message

by Thread?
one thread for output and another for input ?
I have tried it,but it don't work in Swing GUI
is it because the Swing's EDT?

how do you do it usually?

Thank you very much in advance
 

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

No members online now.

Forum statistics

Threads
473,777
Messages
2,569,604
Members
45,227
Latest member
Daniella65

Latest Threads

Top