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. **/
| 244 | Return the number of bytes sent.</doc> |
| 245 | **/ |
| 246 | int _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 |
nothing calls this directly
no test coverage detected