This Page

backend.sockets — Async SSL Sockets

class backend.sockets.AsyncSockets(cafile, nodefile)

Wrapper class to combine asyncore and the below SSL extensions with an interface for the router components

clearExperimentFlags()

Clear all of the experiment flags that were set during poll

clearMessagingFlags()

Clear all of the messsaing flags that were set during poll

closeAll()

Try to close each of the sockets we have opened

createExperimentClient(host)

Create a SSL client for the experiment control side. Must provide a hostname/IP address to connect to

createExperimentServer()

Create a SSL server that listens for messaging node connections

createMessagingClient(addr)

Create a SSL messaging client by connecting to addr. Addr can be ‘hostname/IP’, ‘hostname/IP:port’ or (‘hostname/IP’, ‘port’)

createMessagingServer(port=17707)

Create a SSL server that listens for experiment node connections

createMulticastReceiver(dst, localip)

Create a multicast receiver for listening to a particular multicast dst Expects messages to have a valid HMAC header

createMulticastSender(dst)

Create a multicast sender for sending to a particular multicast dst Will attach an appropriate HMAC header to the outgoing messages

getActiveExperimentSockets()

Get a list of the experiment sockets that have new messages after poll

getActiveMessagingSockets()

Get a list of the messaging sockets that have new messages after poll

getClosedExperimentSockets()

Get a list of the experiment sockets that closed during poll

getClosedMessagingSockets()

Get a list of the messaging sockets that closed during poll

getSockets()

Get a list of the sockets we have opened

poll(timeout)

Call asyncore poll, if we have sockets, otherwise just sleep for timeout as the asyncore code will return immediatly

class backend.sockets.MulticastReceiver(map, addr, localaddr, port, rsa)
getLastHost()
getLastPort()
handle_close()
handle_read()
writable()

Receiver only, this socket never sends anything

class backend.sockets.MulticastSender(map, dest, port, rsa)
handle_write()
writable()
class backend.sockets.SSLClient(map, ctx, host, port, conn=None)
connect(ctx, host, port)
finishConnect()
handle_close()
handle_read()
handle_ssl()

Take care of special function calls needed during initial handshake

handle_write()
startAcceptHandshake()
startConnectHandshake()
writable()
class backend.sockets.SSLServer(map, ctx, port)
getPort()
handle_accept()
class backend.sockets.SecureAsync(map)

Base subclass of dispatcher to provide common logic for the extends SSL classes

clearStats()
createSSLsocket(ctx)

Create a socket with the M2Crypto SSL Connection wrapper

getMessages()
handle_connect()
handle_error()
handle_expt()
put(msg)
recv(buffer_size)
recvfrom(buffer_size)

recvfrom for UDP sockets

setOptions(msgflags, closedflags)

Set the flag sets to use during operation