P
P
Pitonist2242020-04-16 01:10:56
C++ / C#
Pitonist224, 2020-04-16 01:10:56

How to implement chat in c# client-server application?

This action takes place in a game that I have not yet completed in c # wpf (tic-tac-toe for the course).
I did the user authorization, the creation of a lobby, and similar things through requests to the server, everything is clear here, but it’s not clear how to make a chat between two players in the lobby. I think that with the help of requests it will not work (maybe I don’t know something), then what should I do?
Alternatively, you can create a separate thread and communicate with the server in a loop, but in my opinion this is an extra load and this thread will interfere with my other requests to the server (probably haven't tried it yet)

UPD. Sorry, I didn't say what I'm using. I use sockets, protocol tcp.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
E
eRKa, 2020-04-16
@Pitonist224

For such things, there is the SignalR library , with a bunch of examples of how to write a chat on it, for example .
In general, I advise you to dig in this direction.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question