在C#中跨网络设置命名管道的正确方法是什么?
目前我有两台机器,'client‘和'server’。
服务器通过以下方式设置管道:
NamedPipeServerStream pipeServer = new NamedPipeServerStream(
"pipe",
PipeDirection.InOut,
10,
PipeTransmissionMode.Byte,
PipeOptions.None)
pipeServer.WaitForConnection();
//... Read some data from
这是我从哪里借来的代码,我不知道从哪里借来的,可能是这里,也可能是codeguru或codeproject。
无论如何,我想知道是否可以将NULL作为CreateNamedPipe中的最后一个参数传递,或者sa结构是否在NULL之外执行某种类型的安全性?
// Setup the named pipe with a security attribute so it is open to anyone that enquires.
SECURITY_ATTRIBUTES sa;
SECURITY_DESCRIPTOR sd;
InitializeSecurityDescriptor(&s