network programming and sockets handle_expt(called when out-of-band data for socket is received handle_read(called when new data is available to be read from socket handle_write(called when an attempt to write data is made readable(this function is used by the select(loop to see whether the object is willing to read data returns true if sofalse if not this method is called to see if the handle_read(method should be called with new data writable(called by the select(loop to see if the object wants to write data returns true if sofalse otherwise this method is always called to see whether the handle_write(method should be called to produce output in addition to the preceding methodsthe following methods are used to perform low-level socket operations they're similar to those available on socket object accept(accepts connection returns pair (clientaddrwhere client is socket object used to send and receive data on the connection and addr is the address of the client bind(addressbinds the socket to address address is typically tuple (hostport)but this depends the address family being used close(closes the socket connect(addressmakes connection address is tuple (hostportd create_socket(familytypecreates new socket arguments are the same as for socket socket( listen([backlog]listens for incoming connections backlog is an integer that is passed to the underlying socket listen(function recv(sizereceives at most size bytes an empty string indicates the client has closed the channel send(datasends data data is byte string lib fl ff