Jan Dvořák <mordae@anilinux.org>
This module is typed and can be used from both normal and typed code.
syntax
syntax
The 'router socket can send messages to any of it’s peers, always prefixed with that particular peer’s identity part. The other two kinds 'pub and 'sub can connect to each other and allow one-way distribution of messages without the need to identify individual recipients on the sender’s side.
procedure
( socket-kind? v)→Boolean
v:Any
procedure
#:identityidentity#:subscribesubscribe#:bindbind#:connectconnect#:send-queuesend-queuekind:Socket-Kindsend-queue:Naturalreceive-queue:Natural
The send-queue and receive-queue options correspond to ZeroMQ high-water marks. That is, number of packets to buffer when the peer is not available.
procedure
( socket-identity s)→Bytes
s:Sockets:Socket
Changing the identity after connections have been established (via binding or connecting) will most likely not work as desired.
When operating in the 'router mode, first part is reserved for target peer’s identity.
procedure
( socket-receive s)→(Listof Bytes )
s:Socket
When operating in the 'router mode, first part is reserved for target peer’s identity.
procedure
( socket-receive-evt s)→(Evtof (Listof Bytes ))
s:Socket
procedure
( socket-bind saddr)→Void
s:Socketaddr:String
procedure
( socket-connect saddr)→Void
s:Socketaddr:String