MCPcopy Create free account
hub / github.com/emscripten-core/emscripten / start_client

Function start_client

test/sockets/test_tcp_server.c:56–65  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

54}
55
56void start_client(void) {
57 if (client_fd >= 0) close(client_fd);
58 client_fd = socket(AF_INET, SOCK_STREAM, 0);
59 assert(client_fd >= 0);
60 set_nonblocking(client_fd);
61 connected = false;
62 ping_sent = false;
63 int r = connect(client_fd, (struct sockaddr*)&dest, sizeof(dest));
64 assert((r == 0 || errno == EINPROGRESS) && "connect");
65}
66
67void main_loop(void) {
68 fd_set fdr, fdw;

Callers 2

main_loopFunction · 0.70
mainFunction · 0.70

Calls 5

set_nonblockingFunction · 0.70
closeFunction · 0.50
socketFunction · 0.50
assertFunction · 0.50
connectFunction · 0.50

Tested by

no test coverage detected