V
V
vision-bk2015-12-02 17:53:22
C++ / C#
vision-bk, 2015-12-02 17:53:22

How to do a "simulated chat" via NamedPipeClientStream and NamedPipeServerStream?

I understand working with named pipes and as an example of a client and server I take the code from here: https://msdn.microsoft.com/ru-ru/library/system.io... , https://msdn.microsoft.com/ en-us/library/system.io... .
The examples show how the server receives information entered from the console from the client. I'm trying to add to the same code the ability to send messages from the server to the client and read server messages from the client.
Without re-declaring a named pipe for every StreamReader/StreamWriter method, the so-called chat spoof doesn't work and exceptions are thrown. Please tell me if this solution is correct and if there is another way to implement it.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Stanislav Makarov, 2015-12-02
@Nipheris

What exactly are you doing/adding? What are the exceptions? Where in the code?
The question in the current version can only be answered this way:
a) it is possible to build a chat implementation using named pipes;
b) you built an implementation with errors (it is not yet clear which ones);
c) many other ways can be proposed for the implementation of the chat, for example, using TCP / IP and Berkeley sockets, but it is not clear which one you need.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question