represents a socket listener created by SocketListen.


  • The socket listener can be removed with DeleteObject.
  • Properties of the socket listener can be modified with SocketListener[][prop]=val.
  • The property "Socket" returns the SocketObject being listened on by this SocketListener.
  • The following properties can be modified on the SocketListener:
  • CharacterEncoding$CharacterEncodingthe character encoding to assume
    HandlerFunctionsKeysDefaultkeys to include in the data association
    HandlerFunctionsAutomatichow to handle socket events
    RecordSeparatorsNonehow messages are taken to be delimited
  • The following events can be generated while listening on the socket:
  • "DataReceived"data is available on the socket
  • The following default keys are included in the association for each generated event:
  • "Data"the data received, as a string
    "Socket"the SocketObject being listened on
    "SourceSocket"the SocketObject that generated the event
    "Timestamp"time when the event occurred (as a DateObject)
  • The following additional keys can also be requested in HandlerFunctionsKeys:
  • "DataBytes"the raw data received, as a list of byte values
    "DataByteArray"the raw data received, as a ByteArray object
    "MultipartComplete"whether a multipart ZMQ message is complete


Basic Examples  (3)

Listen on an available socket to get a SocketListener:

Get the server socket:

Get the options for the listener:

Stop listening and close the socket:

Listen on an available socket:

Get the server socket:

Change the value of the HandlerFunctionsKeys after starting listening on the socket:

Stop listening and close the socket automatically opened for this listener:

Listen on an available socket and get the underlying socket that was opened to connect to it:

Get the SocketObject that was automatically opened:

Connect the client:

Stop listening and close the sockets:

Introduced in 2017