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

Function make_socket_array

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

Source from the content-addressed store, hash-verified

644static fd_set INVALID;
645
646static fd_set *make_socket_array( Array<Dynamic> a, fd_set *tmp, SOCKET *n )
647{
648 FD_ZERO(tmp);
649 if( !a.mPtr )
650 return tmp;
651
652 int len = a->length;
653 if( len > FD_SETSIZE )
654 hx::Throw(HX_CSTRING("Too many sockets in select"));
655
656 for(int i=0;i<len;i++)
657 {
658 // make sure it is a socket...
659 SOCKET sock = val_sock( a[i] );
660 if( sock > *n )
661 *n = sock;
662 FD_SET(sock,tmp);
663 }
664 return tmp;
665}
666
667static Array<Dynamic> make_array_result( Array<Dynamic> a, fd_set *tmp )
668{

Callers 2

_hx_std_socket_selectFunction · 0.85

Calls 2

ThrowFunction · 0.85
val_sockFunction · 0.85

Tested by

no test coverage detected