ncacn_np attribute
The ncacn_np keyword identifies named pipes as the protocol family for the endpoint.
endpoint("ncacn_np:server-name[\\pipe\\pipe-name]")
-
server-name
-
Optional. Specifies the name of the server. Backslash characters are optional.
-
pipe-name
-
Specifies a valid pipe name. A valid pipe name is a string containing identifiers separated by backslash characters. The first identifier must be pipe. Each identifier must be separated by two backslash characters.
A server creates an instance of a named pipe that is then available to any client. When a client attempts to connect, the existing instance is associated with that client. Before another client can connect, the server must create another instance of the named pipe. If a client tries to bind to the server before the new instance is created, the binding call, RpcBindingFromStringBinding, may fail with the error message RPC_S_SERVER_TOO_BUSY. Therefore, you need to make sure that your client application handles the case where the server is too busy to accept a connection. The client should automatically retry, prompt the user for a course of action, or fail gracefully.
The syntax of the named-pipe port string, like all port strings, is defined by the transport implementation and is independent of the IDL specification. The MIDL compiler performs limited syntax checking but does not guarantee that the endpoint specification is correct. Some classes of errors may be reported at run time rather than at compile time.
[
uuid(12345678-4000-2006-0000-20000000001a),
version(1.1),
endpoint("ncacn_np:[\\pipe\\stove\\hat]")
]
interface iface1
{
// Interface definition statements.
}
[
uuid(87654321-4000-2006-0000-20000000001b),
version(1.1),
endpoint("ncacn_np:\\\\myotherserver[\\pipe\\corncob]")
]
interface iface2
{
// Interface definition statements.
}