MCPcopy Create free account
hub / github.com/crossuo/crossuo / tcp_open

Function tcp_open

src/Sockets.cpp:123–133  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

121}
122
123tcp_socket tcp_open()
124{
125 socket_init();
126 auto h = socket(AF_INET, SOCK_STREAM, IPPROTO_IP);
127 if (h == INVALID_SOCKET)
128 return nullptr;
129
130 auto *s = new SOCKET;
131 *s = h;
132 return (tcp_socket)s;
133}
134
135bool tcp_connect(tcp_socket socket, const char *address, uint16_t port)
136{

Callers 2

InitMethod · 0.85
ConnectMethod · 0.85

Calls 1

socket_initFunction · 0.85

Tested by

no test coverage detected