uses TCPSocket
/* {"description" : "MonitorEvent instances are returned by a TCPMonitor when activity occurs over any of the monitored sockets."} */
data MonitorEvent nocycle {
/* {"@description" : "The socket to which this event relates."} */
TCPSocket socket
/* {"@description" : "The userData (if any) that was associated with this socket in the TCPMonitor."} */
Data userData
/* {"@description" : "The socket is ready to receive some bytes."} */
bool recvReady
/* {"@description" : "The socket previously failed to send all data requested (because one or more buffers was full), and is now ready to send data again. sendBuffer() should be called on the socket before sending any new data."} */
bool sendReady
/* {"@description" : "The socket should be closed (because the remote end has closed their side)."} */
bool close
}
/* {"description" : "Monitor activity over multiple non-blocking sockets."} */
interface TCPMonitor {
/* {"@description" : "Create a new monitor instance."} */
TCPMonitor()
/* {"@description" : "Add a socket to this monitor instance, optionally associating a data instance with it. The monitor will deliver recv and close events by default, indicating that the socket has data available for receive or that it has been closed."} */
bool addSocket(store TCPSocket s, opt store Data userData)
/* {"@description" : "Subscribe for a monitor notification, via wait(), when this socket is next ready for send use. A send-ready notification is only delivered once when the socket first becomes ready; for another notification the user must call this function again."} */
void armSendNotify(TCPSocket s)
/* {"@description" : "Remove a socket from this monitor instance."} */
void remSocket(TCPSocket s)
/* {"@description" : "Wait for activity on any of the sockets in this monitor instance."} */
MonitorEvent[] wait(opt int ms)
}
To propose a new revision to this entity, use dana source put -ut your/new/version.dn -n net.TCPMonitor -m "reason for update" -u yourUsername
Version 1 (this version) by barry
Notes for this version: Standard Library Initialisation