예제 #1
0
 def send(self, message, type, fin=True, status_code=None):
     # here we check if we're sending our custom 'latin_1'
     # message type, and add deflate compression to it by compressing
     # the payload and turning the first reserved bit on.
     if type == 'latin_1':
         self.sock.sendall(
             wscon.send(
                 ws.Data(
                     compress(message), type, fin, status_code, rsv_1=1)))
     else:
         self.sock.sendall(
             wscon.send(ws.Data(message, type, fin, status_code)))
예제 #2
0
 def ws_send(self, message, type, fin=True, status_code=None):
     self.sock.sendall(
         self.ws_conn.send(ws.Data(message, type, fin, status_code)))
예제 #3
0
 async def ws_send(self, message, type):
     await self.sock.sendall(self.wcon.send(ws.Data(message, type, True)))
예제 #4
0
 async def send(self, sender, message, type):
     await self.sock.sendall(
         self.wcon.send(
             ws.Data('|'.join(map(str, sender)) + ': ' + message, type,
                     True)))
예제 #5
0
 async def server_send(self, message, type):
     await self.sock.sendall(
         self.wcon.send(
             ws.Data('*' * 5 + 'Chat|Server:' + message, type, True)))
예제 #6
0
async def ws_send(sock, message, type, fin=True, status_code=None):
    await sock.sendall(wscon.send(ws.Data(message, type, fin, status_code)))