PipeServer Class

Properties   Methods   Events   Configuration Settings   Errors  

The PipeServer class is a lightweight server class based on an asynchronous, event-driven architecture. It is designed to balance the load between connections for a fast, powerful server.




PipeServer is the server complement of PipeClient (which is used to create client applications). They share a common design philosophy and interface. PipeServer is as easy to use as PipeClient.

The client connections are identified by a ConnectionId, an id generated by the component to identify each connection. This id is unique to each connection. PipeServer's events also have ConnectionId as a parameter to identify the connection to which they are related.

Our main goal in designing PipeServer was to make it easy to use without sacrificing performance. The class has a minimum of properties, and events: Connected, DataIn, Disconnected, ReadyToSend, and Error.

PipeServer can start to listen on a pipe by setting PipeName and then setting Listening to True. When a client connects the Connected event fires, a ConnectionId is assigned, and communication can start. From this point on, the operation is very similar to PipeClient. Data is sent by assigning the data string to the DataToSend property.

Property List

The following is the full list of the properties of the class with short descriptions. Click on the links for further details.

ConnectionCountThe number of records in the arrays.
AcceptDataSetting this property to False, temporarily disables data reception (and the DataIn event) on the connection.
BytesSentThis property shows how many bytes were sent after the last assignment to DataToSend .
ConnectedThis property is used to disconnect individual connections and/or show their status.
ConnectionIdThis property contains an identifier generated by the class to identify each connection.
DataToSendThis property contains a string of data to be sent to the remote host.
EOLThe EOL property is used to define boundaries in the input stream using the value of the property.
MaxLineLengthThis property is the size of an internal buffer which holds received data while waiting for an EOL string.
SingleLineModeThis property shows the special mode for line-oriented protocols.
TimeoutThis property specifies a timeout for the class.
DefaultEOLA default EOL value to be used by incoming connections.
DefaultMaxLineLengthThe default maximum line length value for inbound connections.
DefaultSingleLineModeTells the class whether or not to treat new connections as line-oriented.
DefaultTimeoutAn initial timeout value to be used by incoming connections.
ListeningIf True, the class accepts incoming connections.
PipeNameThe name of the pipe.

Method List

The following is the full list of the methods of the class with short descriptions. Click on the links for further details.

ConfigSets or retrieves a configuration setting.
DisconnectDisconnect the specified client.
DoEventsProcesses events from the internal message queue.
InterruptInterrupts a synchronous send to the remote host.
SendSends data to the remote host.
SendFileSend file to the remote host.
SendLineSends a string followed by a newline.
ShutdownShuts down the server.

Event List

The following is the full list of the events fired by the class with short descriptions. Click on the links for further details.

ConnectedFired immediately after a connection completes.
DataInFired when data comes in.
DisconnectedFires when a client disconnects.
ErrorInformation about errors during data delivery.
ReadyToSendFired when the class is ready to send data.

Configuration Settings

The following is a list of configuration settings for the class with short descriptions. Click on the links for further details.

CustomSecurityDescriptionA custom security descriptor to define access to the pipe.
InBufferSizeThe size in bytes of the output buffer.
OutBufferSizeThe size in bytes of the input buffer.
BuildInfoInformation about the product's build.
CodePageThe system code page used for Unicode to Multibyte translations.
LicenseInfoInformation about the current license.
ProcessIdleEventsWhether the class uses its internal event loop to process events when the main thread is idle.
SelectWaitMillisThe length of time in milliseconds the class will wait when DoEvents is called if there are no events to process.
UseInternalSecurityAPITells the class whether or not to use the system security libraries or an internal implementation.

Copyright (c) 2022 /n software inc. - All rights reserved.
IPWorks IPC 2020 C++ Edition - Version 20.0 [Build 8162]