Some questions about making IM p2p software

Discussion in 'Java' started by JTL.zheng, Oct 6, 2006.

  1. JTL.zheng

    JTL.zheng Guest

    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
    JTL.zheng, Oct 6, 2006
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Vladimir Kiselyov
    Replies:
    2
    Views:
    377
    Malte
    Aug 22, 2005
  2. Vladimir Kiselyov
    Replies:
    0
    Views:
    296
    Vladimir Kiselyov
    Aug 17, 2005
  3. Vladimir Kiselyov
    Replies:
    1
    Views:
    317
    Default User
    Aug 17, 2005
  4. Vladimir Kiselyov
    Replies:
    1
    Views:
    342
    Victor Bazarov
    Aug 17, 2005
  5. relisoft
    Replies:
    1
    Views:
    395
    red floyd
    Jul 11, 2006
Loading...

Share This Page