1 Reply Latest reply: Feb 21, 2007 4:13 AM by EJP RSS

    chatting messenger

    807597
      I am final year student. I am making project on instant messenger,I am using Socket programming .I want from my application that when client1 want to chat with any of the online client2,he send that name of the client2 to the server then server send his socket address to the client1,& then client1 connect to the client2 through the socket send by the server.Thus in chatting session betwwen two client's there is no role for server.
      But i am facing a many problem in doing these,

      1)which java.net class i used to establish connection between to client1
      & client2([b]InetSocketAddress;,SocketAddress,SocketImpl,SocketImplFactory)

      2)If suppose client1 want to chat client3,then how client1 discriminate that message is coming from client2 or 3 because both send the message to same input stream.
      These are the problem i'm facing in my project,plz help me in solving my difficulties,and plz give me some suggestion if i'm going in wrong direction.Also suggest me some java classes which will help me in completing my project.

      thank you for suggestions
        • 1. Re: chatting messenger
          EJP
          1)which java.net class i used to establish connection
          between to client1
          &
          client2([b]InetSocketAddress;,SocketAddress,Soc
          ketImpl,SocketImplFactory)
          java.net.Socket.
          2)If suppose client1 want to chat client3,then how
          client1 discriminate that message is coming from
          client2 or 3 because both send the message to same
          input stream.
          No they don't. Each client is represented by a different Socket and each Socket has its own pair of streams. Where did you get this from?