Search code examples
.nettcpudpxmpp

Creating a XMPP chat application with UDP or TCP with .net


I am trying to create a chat application in .net but I am confused whether to use TCP or UDP.

There will be many users, each user need to send a message to the main server which will relay this message to the user. If the user is not online I would need to store the message for later sending.

Of course each message that I send needs to contain the message content, type and the user who wishes to deliver it. I was thinking about using XMPP as the transport layer for performing this.

The server needs to accept connections from many clients.

Each client needs to connect to the server, would they use the same port?


Solution

  • XMPP would be a good choice for your project.

    Goto http://xmpp.org/xmpp-software/libraries/ and find a .NET library. All of them ship with sample code.

    For your firsts tests you can either use a public server, your Gmail id or download and install one of the servers listed here: http://xmpp.org/xmpp-software/servers/