Beispiel #1
0
 def __init__(self, hostname, port, resource):
     SSLConnection.__init__(self)
     self.keys = WebSocketKeys()
     self.header_data = ""
     self.read_buffer = ""
     self.out_buffer = ''
     #synchroneous ssl connection 
     self.connect((hostname, port))
     request = WebSocketHandshakeRequest(resource, hostname, port, self.keys.key1, self.keys.key2, self.keys.key3)
     self.send(HandshakeRequestFormater.format(request))
     self.EVENT_HANDSHAKE_COMPLETED = Event()
     self.EVENT_FRAME = Event()
     self.EVENT_DISCONNECTED = Event()
     self.handshake_completed = False
Beispiel #2
0
 def initiate_send(self):
     num_sent = SSLConnection.send(self, self.out_buffer[:512])
     self.out_buffer = self.out_buffer[num_sent:]