When set to a value different than None this should refer to a
function with two integer parameters: an event code and a detail. This
function will be called upon network-generated events such as urgent
data arrival. Macintosh documentation calls this the
asynchronous service routine. In addition, it is called with
eventcode MACTCP.PassiveOpenDone when a PassiveOpencompletes. This is a Python addition to the MacTCP semantics.
It is safe to do further calls from asr.
Wait for an incoming connection on TCP port port (zero makes the
system pick a free port). The call returns immediately, and you should
use wait() to wait for completion. You should not issue any method
calls other than wait(), isdone() or
GetSockName() before the call completes.
Open an outgoing connection to TCP address (host,
rport). Use
local port lport (zero makes the system pick a free port). This
call blocks until the connection has been established.
Receive data. The call returns when timeout seconds have passed
or when (according to the MacTCP documentation) ``a reasonable amount
of data has been received''. The return value is a 3-tuple
(data, urgent, mark). If urgent data is
outstanding Rcv will always return that before looking at any
normal data. The first call returning urgent data will have the
urgent flag set, the last will have the mark flag set.