Exemple #1
0
 def send(self, data, compression=None):
     if not self._mm_connected:
         raise MastermindErrorClient(
             "Client must be connected with .connect() to send data!")
     if not netutil.packet_send(self._mm_socket,
                                (self._mm_connection_type, None), data,
                                compression):
         raise MastermindErrorClient(
             "Client sending has failed!  Call .disconnect() and then .connect() to try to reestablish the connection."
         )
Exemple #2
0
 def callback_client_send(
     self,
     connection_object,
     data,
     compression=None
 ):  #Called to send data to a client                           CAN OVERRIDE      IF super() CALLED
     result = netutil.packet_send(
         connection_object.socket,
         (self._mm_connection_type, connection_object.address), data,
         compression)
     if not result:
         connection_object.terminate()
     return result
Exemple #3
0
 def send(self, data, compression=None):
     if not self._mm_connected:
         raise MastermindErrorClient("Client must be connected with .connect() to send data!")
     
     if not netutil.packet_send(self._mm_socket,(self._mm_connection_type,None), data,compression):
         raise MastermindErrorClient("Client sending has failed!  Call .disconnect() and then .connect() to try to reestablish the connection.")
Exemple #4
0
 def callback_client_send      (self, connection_object, data,compression=None):      #Called to send data to a client                           CAN OVERRIDE      IF super() CALLED
     result = netutil.packet_send(connection_object.socket,(self._mm_connection_type,connection_object.address), data,compression)
     if not result:
         connection_object.terminate()
     return result