Discussion Locked

Is there another alternative?

0 helpful
1 reply
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.
Am in the midst of developing a chat application, and am wondering if there is any other way to allow clients to create new rooms without having to initialize Server sockets(to listen for other client connections to the newly created room) on the server, as this will keep taking up ports. Will using vectors and hashtables help?

1 reply

by dljohnston

My own preference would be to build it on top of a connectionless socket (UDP). And imbed protocol information in the UDP packet that indicates which room:group:user the messages are directed to.
In order to create a new room invent a special packet that communicates only to the server and issues a request for a new room to be created.
Check out the Daytime protocol for examples of UDP socket creation and usage.
This might not be to your liking, if that is the case then I am not sure what todo. There are a limited number of ports and you are at a disadvantage having to start above the well know port numbers and even then you could be stepping on other protocols which have port numbers registered above the well known port numbers.

Anyways, hope it helps,
D

This discussion is closed to new replies.