Customer selection on Sokate Interaction



  • I'm going to. Rockets Right now. I wrote the client and server parts. It's working well. Just one moment. I don't understand how to make it possible to choose which client is to send messages from the server. A week of google was gone. Reading. SealerscomparatorsArrayList♪ I don't get it. It's all right.



  • You just need to get customers identified. This can be done approximately:

    TestSocket mySocket = (TestSocket) serverSocket.accept();
    

    public void sendID() {
    DataOutputStreak dos = new DataOutputStream(getOuputStream());
    dos.writeUTF(this.getId());
    }

    public void receiveID() {
    DataInputStream dis = new DataInputStream(getInputStream());
    setId(dis.readUTF());
    }


Log in to reply
 


Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2