sabato 15 ottobre 2016

Day 177: UDP chat

Today I managed to implement completely the chat in UDP.
Each client now gets registered with the server when it first sends a message to it.
I made it simpler by removing some error checking (i.e. if a message is received partially, because I think that UDP should grant that a datagram is always received fully).
I had a few problems with the template functions because for some reasons they were not compiled along the code, but in the end I managed to get them working.
The server still used a select, but it is only interested in its socket, since UDP is connectionless. Not sure if this is a good implementation, but for now I'll leave it like that.
In the picture the top right client starts to send a couple of messages (which are structures containing data), and he is the only one receiving them. Then the second client does the same, and both receives the messages, and so on.


Nessun commento:

Posta un commento