Skip to content

Commit 8601e4e

Browse files
authored
Add note about thread safety (#10848)
1 parent 564260b commit 8601e4e

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

xml/System.IO.Pipes/NamedPipeServerStream.xml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,14 +52,18 @@
5252
<format type="text/markdown"><![CDATA[
5353
5454
## Remarks
55-
Named pipes provide one-way or duplex pipes for communication between a pipe server and one or more pipe clients. Named pipes can be used for interprocess communication locally or over a network. A single pipe name can be shared by multiple <xref:System.IO.Pipes.NamedPipeClientStream> objects.
5655
57-
Any process can act as either a named pipe server or client, or both.
56+
Named pipes provide one-way or duplex pipes for communication between a pipe server and one or more pipe clients. Named pipes can be used for interprocess communication locally or over a network. A single pipe name can be shared by multiple <xref:System.IO.Pipes.NamedPipeClientStream> objects.
57+
58+
Any process can act as either a named pipe server or client, or both.
59+
60+
With regards to thread safety for reading and writing, up to a single reader and a single writer can use an instance concurrently.
5861
5962
## Examples
60-
The following example demonstrates a way to send a string from a parent process to a child process on the same computer using named pipes. This example creates a <xref:System.IO.Pipes.NamedPipeServerStream> object in a parent process with a <xref:System.IO.Pipes.PipeDirection> value of <xref:System.IO.Pipes.PipeDirection.Out>. The server then waits for a <xref:System.IO.Pipes.NamedPipeClientStream> object in a child process to connect to it. In this example, both processes are on the same computer and the <xref:System.IO.Pipes.NamedPipeClientStream> object has a <xref:System.IO.Pipes.PipeDirection> value of <xref:System.IO.Pipes.PipeDirection.In>. The parent process then sends a user-supplied string to the child process. The string is displayed to the console.
6163
62-
This example is for the server process, which uses the <xref:System.IO.Pipes.NamedPipeServerStream> class. For the entire code example, including the code for both the pipe client and server, see [How to: Use Named Pipes for Network Interprocess Communication](/dotnet/standard/io/how-to-use-named-pipes-for-network-interprocess-communication).
64+
The following example demonstrates a way to send a string from a parent process to a child process on the same computer using named pipes. This example creates a <xref:System.IO.Pipes.NamedPipeServerStream> object in a parent process with a <xref:System.IO.Pipes.PipeDirection> value of <xref:System.IO.Pipes.PipeDirection.Out>. The server then waits for a <xref:System.IO.Pipes.NamedPipeClientStream> object in a child process to connect to it. In this example, both processes are on the same computer and the <xref:System.IO.Pipes.NamedPipeClientStream> object has a <xref:System.IO.Pipes.PipeDirection> value of <xref:System.IO.Pipes.PipeDirection.In>. The parent process then sends a user-supplied string to the child process. The string is displayed to the console.
65+
66+
This example is for the server process, which uses the <xref:System.IO.Pipes.NamedPipeServerStream> class. For the entire code example, including the code for both the pipe client and server, see [How to: Use Named Pipes for Network Interprocess Communication](/dotnet/standard/io/how-to-use-named-pipes-for-network-interprocess-communication).
6367
6468
:::code language="csharp" source="~/snippets/csharp/System.IO.Pipes/NamedPipeServerStream/Overview/Program.cs" id="Snippet01":::
6569
:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR_System/system.IO.Pipes.NamedPipeServerStream_Sample1/vb/program.vb" id="Snippet01":::

0 commit comments

Comments
 (0)