MCPcopy
hub / github.com/pyodide/pyodide / run

Function run

src/tests/test_python_socket.py:71–82  ·  view source on GitHub ↗
(selenium, host, port, message)

Source from the content-addressed store, hash-verified

69
70 @run_in_pyodide
71 async def run(selenium, host, port, message):
72 import socket
73
74 s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
75 s.connect((host, port))
76
77 s.sendall(message)
78
79 response = s.recv(1024)
80
81 s.close()
82 return response.decode()
83
84 with tcp_server(handler) as (host, port):
85 result = run(selenium_nodesock, host, port, TEST_MESSAGE)

Callers 15

_mypy_checkFunction · 0.70
test_socket_connectFunction · 0.70
test_socket_getpeernameFunction · 0.70
test_socket_getsocknameFunction · 0.70
test_socket_filenoFunction · 0.70
test_socket_recv_eofFunction · 0.70

Calls 15

wrap_socketMethod · 0.95
socket_taskFunction · 0.85
do_echoFunction · 0.85
connectMethod · 0.80
sendallMethod · 0.80
recvMethod · 0.80
shutdownMethod · 0.80
bindMethod · 0.80
get_event_loopMethod · 0.80
sock_connectMethod · 0.80
sock_sendallMethod · 0.80
sock_recvMethod · 0.80

Tested by

no test coverage detected