コード例 #1
0
ファイル: test_mp.py プロジェクト: JammyWei/mtcpsoft
def f(a, b):

    print("sub process", os.getpid())
    try:
        print("size", b.qsize())
        h = b.get()
        s = rebuild_socket(h, socket.AF_INET, socket.SOCK_STREAM, 0)
        # fd = rebuild_handle(h)
        # s = socket.fromfd(fd,socket.AF_INET,socket.SOCK_STREAM)
        s.send(b"1111")
        print(s)
        print(s.getsockname())
    except Exception as e:
        print(e)
コード例 #2
0
ファイル: test_mp.py プロジェクト: JammyWei/mtcpsoft
def f(a, b):

    print('sub process', os.getpid())
    try:
        print('size', b.qsize())
        h = b.get()
        s = rebuild_socket(h, socket.AF_INET, socket.SOCK_STREAM, 0)
        #fd = rebuild_handle(h)
        #s = socket.fromfd(fd,socket.AF_INET,socket.SOCK_STREAM)
        s.send(b'1111')
        print(s)
        print(s.getsockname())
    except Exception as e:
        print(e)
コード例 #3
0
    def __init__(self, serialized_sock):
        """
        Initializes ClientHandler with the socket contained in serialized_sock.

        Args:
            serialized_sock: A serialized socket connected to a client.
        """

        # Deserialize the client socket from the input:
        self._client_socket = rebuild_socket(serialized_sock[0],
                                             serialized_sock[1],
                                             serialized_sock[2],
                                             serialized_sock[3])
        # Initialize the connection state:
        self._connection_state = ProxyState.OPENING
        # Initialize a placeholder for the target socket:
        self._target_socket = None
コード例 #4
0
ファイル: util.py プロジェクト: nckatiku/mara
 def deserialise_socket(serialised):
     return reduction.rebuild_socket(*serialised)
コード例 #5
0
	def _socket(self, picklable):
		args = pickle.loads(picklable)
		sock = rebuild_socket(*args)
		self._class.socks.put(sock)
コード例 #6
0
	def _socket(self, picklable):
		args = pickle.loads(picklable)
		sock = rebuild_socket(*args)
		self._class.socks.put(sock)