Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

I/O

Since ProSA is designed to connect to external systems, helpers for I/O operation are essential.

This page covers I/O from server and client perspectives, with a few examples.

Listener

StreamListener type is used to handle server sockets. It can be instantiated from a ListenerSetting using the bind method.

It supports three types of server sockets:

  • UNIX
  • TCP
  • SSL

Once the object is created, you must call the accept method in a loop to accept client connections. Each accepted connection will create a Stream socket, which can be managed just like a client socket.

Stream

A Stream represents a client socket or a socket created by a StreamListener when a client connects. It can be instantiated from a TargetSetting using the connect method.

It supports several types of client sockets:

  • UNIX
  • TCP
  • SSL
  • TCP over HTTP proxy
  • SSL over HTTP proxy

You can manually connect using the connect_* methods as appropriate.

After creating the socket, you have several options to further configure it, such as:

  • nodelay
  • ttl

IO macro

This section will be documented when the macro becomes stable, or removed if it is not relevant.