Bogdan Popa <bogdan@defn.io>
This package provides an implementation of a TCP listener that accepts connections and dispatches them to places, enabling its users to parallelize their TCP servers, similar to the implementation described in Parallelizing the Racket Web Server.
procedure
v:any/c
procedure
port[ #:boot-timeoutboot-timeout#:parallelismparallelism#:hostnamehostname#:backlogbacklog#:reuse?reuse?#:tcp@tcp@])port:listen-port-number?
The #:parallelism argument controls the number of places started by the listener.
The #:boot-timeout argument determines how long the listener waits for the places it starts to finish booting. If all the places fail to boot within the allotted time, an exception is raised.
The #:backlog and #:reuse? arguments have the same meaning as the max-allow-wait and reuse? arguments to tcp-listen , respectively.
The #:tcp@ argument can be used to provide a different underlying tcp^ implementation (eg. make-ssl-tcp@ ).
For example:
tcp@(syncreceiver-dead-evtlistener(echoinout)(loop)))))))
procedure
procedure
procedure
procedure
( start-place-tcp-receiver place-channel)
place-channel:place-channel?
A positive integer, p, representing the number of receiver places.
An integer representing the place’s unique id in the range [0, p).
The hostname passed to place-tcp-listen in the main place.
The port number passed to place-tcp-listen in the main place.
A tcp^ unit that can be used to accept new connections from the main place.
An event that becomes ready for synchronization when the main place listener has been stopped.