You should create the server in the bot atleast that's my opinion and that's what i did in my first attempts.
If ure using C# it's terribly easy to create a pipeserver just a couple of rows.
Code:
using System;
using System.IO;
using System.IO.Pipes;
class PipeServer
{
static void Main()
{
NamedPipeServerStream pipeServer =
new NamedPipeServerStream("testpipe", PipeDirection.Out))
Console.WriteLine("NamedPipeServer created.");
Console.Write("Waiting for client connection...");
pipeServer.WaitForConnection();
Console.WriteLine("Client connected.");
pipeServer.WriteByte(0xFF);
}
}
So that's the C# part now you just need to connect to it from C++ your dll or w/e language you are using.
Here's some code to chew make the best of it
Code:
HANDLE hPipe;
if( ! WaitNamedPipe("\\\\.\\pipe\\testpipe", 25000) ){
//Error waiting for pipe
return 1;
}
hPipe = CreateFile("\\\\.\\pipe\\testpipe",
GENERIC_READ | GENERIC_WRITE,
0, NULL, OPEN_EXISTING, 0, NULL);
if( hPipe == INVALID_HANDLE_VALUE )
{
//"Error: cannot open named pipe\n";
return;
}
char buf[1024];
DWORD bread;
for(int i=0;i<15;i++)
{
if( ReadFile(npipe, (void*)buf, 1023, &bread, NULL) )
{
buf[bread] = 0;
cout<<"Received: '"<<buf<<"'"<<endl;
}
Sleep(750);
}
Hope this helps some
here's some links too
A little example using pipes with .Net 3.5 - .NET 3.5 Adds Named Pipes Support | Switch on the Code
Some examples on how to do it with C++ - Advanced C++ Programming: Named pipes.