Jump to content

  • Log In with Google      Sign In   
  • Create Account

#ActualKylotan

Posted 22 January 2013 - 11:03 AM

You will already have the friend's socket because they are connected to you, and you can send the information down that socket. Or, you can send information down that socket to tell the friend's client to open a new connection.

This only works when the friend is online. If the friend is offline you can't send anything. You could choose to store the message on the server in a queue until they log on.

You know that a given socket belongs to the right person because they probably had to authenticate (eg. username/password) in order to connect it to your server.

When the friend logs out, you can tell the other person that they can't send messages any more. If they try, send a reply saying that it failed.

#1Kylotan

Posted 22 January 2013 - 11:03 AM

You will already have the friend's socket because they are connected to you, and you can send the information down that socket. Or, you can send information down that socket to tell the friend's client to open a new connection.<br /><br />This only works when the friend is online. If the friend is offline you can't send anything. You could choose to store the message on the server in a queue until they log on.<br /><br />You know that a given socket belongs to the right person because they probably had to authenticate (eg. username/password) in order to connect it to your server.<br /><br />When the friend logs out, you can tell the other person that they can't send messages any more. If they try, send a reply saying that it failed.

PARTNERS