tcpsockets/client.py
def send(self, obj: Any, byte_converter: Callable[[Any], bytes] = None) -> None:
        """
        Send a python object that can be pickled to the server. First sends a fixed length header defined in
        tcpsockets.settings giving the size of outgoing message then sends the pickled object. default_header_size
        can be set by using tcpsockets.settings.set_default_header_size function.

        Args:
            byte_converter(Callable[[Any], bytes]): Function to convert object to bytes.
            obj(Any): The Object that has to be sent to the server that can be pickled.

        Returns:
            None

        """
        if byte_converter is None:
            bytes_obj = pickle.dumps(obj)
        else:
            bytes_obj = byte_converter(obj)
        bytes_obj_size = len(bytes_obj)
        header = str(bytes_obj_size).ljust(default_header_size).encode("utf-8")
        self.socket.send(header)
        self.socket.send(bytes_obj)

        Send a python object that can be pickled to the server. First sends a fixed length header defined in
        tcpsockets.settings giving the size of outgoing message then sends the pickled object. default_header_size
        can be set by using tcpsockets.settings.set_default_header_size function.

        Args:
            byte_converter(Callable[[Any], bytes]): Function to convert object to bytes.
            obj(Any): The Object that has to be sent to the server that can be pickled.

        Returns:
            None

        
Send a python object that can be pickled to the server. First sends a fixed length header defined in
tcpsockets.settings giving the size of outgoing message then sends the pickled object. default_header_size
can be set by using tcpsockets.settings.set_default_header_size function.
Send a python object that can be pickled to the server . First sends a fixed length header defined in tcpsockets . settings giving the size of outgoing message then sends the pickled object . default_header_size can be set by using tcpsockets . settings . set_default_header_size function .
def send(self, obj: Any, byte_converter: Callable[[Any], bytes] = None) -> None:
        if byte_converter is None:
            bytes_obj = pickle.dumps(obj)
        else:
            bytes_obj = byte_converter(obj)
        bytes_obj_size = len(bytes_obj)
        header = str(bytes_obj_size).ljust(default_header_size).encode("utf-8")
        self.socket.send(header)
        self.socket.send(bytes_obj)
def send ( self , obj : Any , byte_converter : Callable [ [ Any ] , bytes ] = None ) -> None : if byte_converter is None : bytes_obj = pickle . dumps ( obj ) else : bytes_obj = byte_converter ( obj ) bytes_obj_size = len ( bytes_obj ) header = str ( bytes_obj_size ) . ljust ( default_header_size ) . encode ( "utf-8" ) self . socket . send ( header ) self . socket . send ( bytes_obj )
Send a python object that can be pickled to the server.
Send a python object that can be pickled to the server .
"""
        Send a python object that can be pickled to the server. First sends a fixed length header defined in
        tcpsockets.settings giving the size of outgoing message then sends the pickled object. default_header_size
        can be set by using tcpsockets.settings.set_default_header_size function.

        Args:
            byte_converter(Callable[[Any], bytes]): Function to convert object to bytes.
            obj(Any): The Object that has to be sent to the server that can be pickled.

        Returns:
            None

        """
None
self
obj
Any
The Object that has to be sent to the server that can be pickled.
The Object that has to be sent to the server that can be pickled .
byte_converter
Callable[[Any], bytes]
Function to convert object to bytes.
Function to convert object to bytes .