1

How to turn stream from Named Pipe into Socket Stream? (in on Windows) (Share all new data in pipe stream on socket)?

Vlad
  • 9,180
  • 5
  • 48
  • 67
Rella
  • 65,003
  • 109
  • 363
  • 636
  • 1
    [Answered here](http://stackoverflow.com/questions/230128/best-way-to-copy-between-two-stream-instances-c "Stackoverflow") already? – anton.burger Jun 16 '10 at 08:37

1 Answers1

1

The nice thing of named pipes in Windows is that they already work in a network just specifying the server name in the:

CreateFile("\\ServerName\pipe\PipeName", ...

However, if this not fits your needs, you just have to build a read loop (I suggest OVERLAPPED I/O) that, at every read from the pipe, writes the received data to the socket.

lornova
  • 6,667
  • 9
  • 47
  • 74