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

◆ AnonymousPipeClientStream() [2/3]

System.IO.Pipes.AnonymousPipeClientStream.AnonymousPipeClientStream ( PipeDirection direction,
string pipeHandleAsString )
inline

Definition at line 31 of file AnonymousPipeClientStream.cs.

32 : base(direction, 0)
33 {
34 if (direction == PipeDirection.InOut)
35 {
36 throw new NotSupportedException(System.SR.NotSupported_AnonymousPipeUnidirectional);
37 }
38 if (pipeHandleAsString == null)
39 {
40 throw new ArgumentNullException("pipeHandleAsString");
41 }
42 long result = 0L;
43 if (!long.TryParse(pipeHandleAsString, out result))
44 {
45 throw new ArgumentException(System.SR.Argument_InvalidHandle, "pipeHandleAsString");
46 }
47 SafePipeHandle safePipeHandle = new SafePipeHandle((IntPtr)result, ownsHandle: true);
48 if (safePipeHandle.IsInvalid)
49 {
50 throw new ArgumentException(System.SR.Argument_InvalidHandle, "pipeHandleAsString");
51 }
52 Init(direction, safePipeHandle);
53 }
void Init(PipeDirection direction, SafePipeHandle safePipeHandle)
SafePipeHandle SafePipeHandle
static string Argument_InvalidHandle
Definition SR.cs:24
static string NotSupported_AnonymousPipeUnidirectional
Definition SR.cs:90
Definition SR.cs:7

References System.SR.Argument_InvalidHandle, System.IO.Pipes.AnonymousPipeClientStream.Init(), Microsoft.Win32.SafeHandles.SafeHandleZeroOrMinusOneIsInvalid.IsInvalid, System.L, System.SR.NotSupported_AnonymousPipeUnidirectional, and System.IO.Pipes.PipeStream.SafePipeHandle.