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
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