MCPcopy Create free account
hub / github.com/HaxeFoundation/hxcpp / _hx_std_socket_send

Function _hx_std_socket_send

src/hx/libs/std/Socket.cpp:246–260  ·  view source on GitHub ↗

socket_send : 'socket -> buf:string -> pos:int -> len:int -> int Send up to [len] bytes from [buf] starting at [pos] over a connected socket. Return the number of bytes sent. **/

Source from the content-addressed store, hash-verified

244 Return the number of bytes sent.</doc>
245**/
246int _hx_std_socket_send( Dynamic o, Array<unsigned char> buf, int p, int l )
247{
248 SOCKET sock = val_sock(o);
249 int dlen = buf->length;
250 if( p < 0 || l < 0 || p > dlen || p + l > dlen )
251 return 0;
252
253 const char *base = (const char *)&buf[0];
254 hx::EnterGCFreeZone();
255 dlen = send(sock, base + p , l, MSG_NOSIGNAL);
256 if( dlen == SOCKET_ERROR )
257 block_error();
258 hx::ExitGCFreeZone();
259 return dlen;
260}
261
262/**
263 socket_recv : 'socket -> buf:string -> pos:int -> len:int -> int

Callers

nothing calls this directly

Calls 4

val_sockFunction · 0.85
EnterGCFreeZoneFunction · 0.85
ExitGCFreeZoneFunction · 0.85
block_errorFunction · 0.70

Tested by

no test coverage detected