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.
Syntax
class ipworksipc.PipeServer
Remarks
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: on_connected, on_data_in, on_disconnected, on_ready_to_send, and on_error.
PipeServer can start to listen on a pipe by setting pipe_name and then setting listening to True. When a client connects the on_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 data_to_send 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.
connection_count | The number of records in the arrays. |
accept_data | Setting this property to False, temporarily disables data reception (and the DataIn event) on the connection. |
bytes_sent | This property shows how many bytes were sent after the last assignment to DataToSend . |
connected | This property is used to disconnect individual connections and/or show their status. |
connection_id | This property contains an identifier generated by the class to identify each connection. |
data_to_send | This property contains a string of data to be sent to the remote host. |
eol | The EOL property is used to define boundaries in the input stream using the value of the property. |
max_line_length | This property is the size of an internal buffer which holds received data while waiting for an EOL string. |
single_line_mode | This property shows the special mode for line-oriented protocols. |
timeout | This property specifies a timeout for the class. |
default_eol | A default EOL value to be used by incoming connections. |
default_max_line_length | The default maximum line length value for inbound connections. |
default_single_line_mode | Tells the class whether or not to treat new connections as line-oriented. |
default_timeout | An initial timeout value to be used by incoming connections. |
listening | If True, the class accepts incoming connections. |
pipe_name | The 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.
config | Sets or retrieves a configuration setting. |
disconnect | Disconnect the specified client. |
do_events | Processes events from the internal message queue. |
interrupt | Interrupts a synchronous send to the remote host. |
send | Sends data to the remote host. |
send_file | Send file to the remote host. |
send_line | Sends a string followed by a newline. |
shutdown | Shuts 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.
on_connected | Fired immediately after a connection completes. |
on_data_in | Fired when data comes in. |
on_disconnected | Fires when a client disconnects. |
on_error | Information about errors during data delivery. |
on_ready_to_send | Fired 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.
CustomSecurityDescription | A custom security descriptor to define access to the pipe. |
InBufferSize | The size in bytes of the output buffer. |
OutBufferSize | The size in bytes of the input buffer. |
BuildInfo | Information about the product's build. |
CodePage | The system code page used for Unicode to Multibyte translations. |
LicenseInfo | Information about the current license. |
ProcessIdleEvents | Whether the class uses its internal event loop to process events when the main thread is idle. |
SelectWaitMillis | The length of time in milliseconds the class will wait when DoEvents is called if there are no events to process. |
UseInternalSecurityAPI | Tells the class whether or not to use the system security libraries or an internal implementation. |