P
PFx
Hi, i am having a difficult time with developing an application using
asynchronous named pipes. I use a NamedPipeServerStream but for some reason
my beginwaitforconnection-callback-method gets executed at 'strange' times;
like when closing the server. The server-application is a Windows-forms app
Do I have to disconnect in the callback-method?
Am I missing something else?
The namedpipeserverstream is set up in method main()
internal void main()
{
this._pipe = new NamedPipeServerStream("abc"
, PipeDirection.In
, 1
, PipeTransmissionMode.Byte
, PipeOptions.Asynchronous
);
setUpPipe();
Application.Run(new Form1());
}
My callback-code looks like this:
private void setUpPipe()
{
this._pipe.BeginWaitForConnection(
iar => {
this._pipe.EndWaitForConnection(iar);
System.Diagnostics.Debug.WriteLine("...");
this._pipe.Disconnect();
setUpPipe();
}
, null
);
}
Kind regards
asynchronous named pipes. I use a NamedPipeServerStream but for some reason
my beginwaitforconnection-callback-method gets executed at 'strange' times;
like when closing the server. The server-application is a Windows-forms app
Do I have to disconnect in the callback-method?
Am I missing something else?
The namedpipeserverstream is set up in method main()
internal void main()
{
this._pipe = new NamedPipeServerStream("abc"
, PipeDirection.In
, 1
, PipeTransmissionMode.Byte
, PipeOptions.Asynchronous
);
setUpPipe();
Application.Run(new Form1());
}
My callback-code looks like this:
private void setUpPipe()
{
this._pipe.BeginWaitForConnection(
iar => {
this._pipe.EndWaitForConnection(iar);
System.Diagnostics.Debug.WriteLine("...");
this._pipe.Disconnect();
setUpPipe();
}
, null
);
}
Kind regards