Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ AnonymousPipeServerStream() [4/6]

System.IO.Pipes.AnonymousPipeServerStream.AnonymousPipeServerStream ( PipeDirection direction,
SafePipeHandle serverSafePipeHandle,
SafePipeHandle clientSafePipeHandle )
inline

Definition at line 55 of file AnonymousPipeServerStream.cs.

56 : base(direction, 0)
57 {
58 if (direction == PipeDirection.InOut)
59 {
60 throw new NotSupportedException(System.SR.NotSupported_AnonymousPipeUnidirectional);
61 }
62 if (serverSafePipeHandle == null)
63 {
64 throw new ArgumentNullException("serverSafePipeHandle");
65 }
66 if (clientSafePipeHandle == null)
67 {
68 throw new ArgumentNullException("clientSafePipeHandle");
69 }
70 if (serverSafePipeHandle.IsInvalid)
71 {
72 throw new ArgumentException(System.SR.Argument_InvalidHandle, "serverSafePipeHandle");
73 }
74 if (clientSafePipeHandle.IsInvalid)
75 {
76 throw new ArgumentException(System.SR.Argument_InvalidHandle, "clientSafePipeHandle");
77 }
78 ValidateHandleIsPipe(serverSafePipeHandle);
79 ValidateHandleIsPipe(clientSafePipeHandle);
80 InitializeHandle(serverSafePipeHandle, isExposed: true, isAsync: false);
81 _clientHandle = clientSafePipeHandle;
83 base.State = PipeState.Connected;
84 }
void ValidateHandleIsPipe(SafePipeHandle safePipeHandle)
void InitializeHandle(SafePipeHandle? handle, bool isExposed, bool isAsync)
static string Argument_InvalidHandle
Definition SR.cs:24
static string NotSupported_AnonymousPipeUnidirectional
Definition SR.cs:90
Definition SR.cs:7

References System.IO.Pipes.AnonymousPipeServerStream._clientHandle, System.IO.Pipes.AnonymousPipeServerStream._clientHandleExposed, System.SR.Argument_InvalidHandle, System.IO.Pipes.PipeStream.InitializeHandle(), Microsoft.Win32.SafeHandles.SafeHandleZeroOrMinusOneIsInvalid.IsInvalid, System.SR.NotSupported_AnonymousPipeUnidirectional, and System.IO.Pipes.PipeStream.ValidateHandleIsPipe().