2012-09-18

by amitavak (Posted Tue Sep 18, 2012 5:28 am)

Quote:

Hi J.Sh3ppard,

I'm always eager to know the best way to accomplish something. From the discussion, I came to know TCPSocket is the best way to make a chatting app. I made that one using udp for learning purpose.

Now i'm going to replace udp with tcp in that existing chat app. Few thing struck in my mind.

When a user login, udp sends a multicast message say "Someone signed on:username". When some user receive that message, it checks it's contact list if that username is listed there, it marks him as online. At the same time it also store the remote address, the message came from with the corrosponding contact. So that during chat, i can know at which address i need to send the message.

So how can I handle this thing using tcp? How will i send the message to all the user in the same network? Do i really need to make a chat server for that?

Edit: Now sign out functionality works perfectly with TCPSocket(I used TCPSocke to send "sign out" message only). But I need to get some idea about the above question before i move to TCP totally?

Read the main topic related to this post

Show more