From the course: Developing Distributed Applications with C# and ZeroMQ

Unlock the full course today

Join today to access over 22,500 courses taught by industry experts or purchase this course individually.

Exercise 3a: Extending the server to relay group messages

Exercise 3a: Extending the server to relay group messages

From the course: Developing Distributed Applications with C# and ZeroMQ

Start my 1-month free trial

Exercise 3a: Extending the server to relay group messages

- [Instructor] Now we can upgrade our server so that it can receive talk messages from the client. What we'll do is we'll come into our main function, specifically into our message loop where we process client requests, and we will handle a new case. If a client sends us a talk message, it means they have some information they would like shared with the rest of the group. So the first thing we will do is update the client's expiry, because obviously they're still active and still communicating with us. Then we'll create a new message and send it to the group via the pub socket. We'll use the same news message function which we used previously to construct our welcome and goodbye messages. However, instead of the group sender, meaning the message coming from the server itself, we'll actually use the client who initiated it as the sender, which we get from the message we just decoded. The decoded message also contains the actual content, which will be the other part of our message…

Contents