Two Windows *console* programs that cooperate with each other to provide a named-pipe conduit between any TCP client and any TCP server.
client <--> **tcptonp** <-- named pipe --> **nptotcp** <--> server
**tcptonp:
**
tcptonp accepts a TCP socket connection, then connects to a named pipe on another machine to relay data between the socket and the pipe. Only one client connection is allowed at a time. Once either side breaks the connection it should ensure both connections are closed and then start listening for clients again.
Command syntax:
tcptonp port named_pipe
e.g.
tcptonp 2001 \\serverA\PIPE\connection1
tcptonp listens on the specified port (2001). When a client connects it then establishes a client connection to the specified named pipe. Until one of the connections is broken it passes data that arrives on the socket to the pipe and vice versa. If either connection is broken it also closes the other connection and waits for another client.
**nptotcp:
**Similar to tcptonp, nptotcp accepts a named pipe connection, then connects to a TCP port on another machine to relay data between the socket and the pipe.
Command syntax:
nptotcp named_pipe remotehost port
e.g.
nptotcp [\\.\PIPE\connection1][1] eastrtr1 2001
nptotcp listens on the specified pipe. When a client connects it opens a socket to the specified remote host and TCP port. Otherwise its behavior is identical to tcptonp.
**Performance Requirements
**Speed is very important for both programs. As soon as data arrives on the socket it should be sent to the named pipe and vice versa. This may require threads, asynchronous/overlapped IO, etc. to prevent blocking while reading the socket and thus not processing pipe data and vice versa.
## Deliverables
1. Full source code including Visual Studio project files for the two programs - tcptonp and nptotcp - as described.
2. The programs must be written in C/C++. They must compile in Visual Studio 2003 without modification (if an older VS version is used, it is enough that it can be automatically converted by VS 2003 without errors).
3. The resulting executables must be Windows console programs, capable of running on any version of Windows from 2000 and up.
4. All deliverables will be considered "work made for hire" under U.S. Copyright law. Buyer will receive exclusive and complete copyrights to all work purchased. (No GPL, GNU, 3rd party components, etc. unless all copyright ramifications are explained AND AGREED TO by the buyer on the site per the coder's Seller Legal Agreement).
## Platform
Windows 2000/XP/2003