socket :: NativeSocketObserver :: select
FIXME this implementation is broken.reads
, write
and except
socket $ NativeSocketObserver :: SELF
Type of this instance, automatically specialized in every classcore :: Object :: class_factory
Implementation used byget_class
to create the specific class.
core :: Object :: defaultinit
core :: Object :: is_same_instance
Return true ifself
and other
are the same instance (i.e. same identity).
core :: Object :: is_same_serialized
Isself
the same as other
in a serialization context?
core :: Object :: is_same_type
Return true ifself
and other
have the same dynamic type.
core :: Object :: output_class_name
Display class name on stdout (debug only).socket :: NativeSocketObserver :: select
FIXME this implementation is broken.reads
, write
and except
# Socket observer
class NativeSocketObserver
# FIXME this implementation is broken. `reads`, `write` and `except`
# are boxed objects, passing them to a C function is illegal.
fun select(max: NativeSocket, reads: nullable NativeSocketSet, write: nullable NativeSocketSet,
except: nullable NativeSocketSet, timeout: NativeTimeval): Int `{
fd_set *rds = NULL,
*wts = NULL,
*exs = NULL;
struct timeval *tm = NULL;
if (reads != NULL) rds = (fd_set*)reads;
if (write != NULL) wts = (fd_set*)write;
if (except != NULL) exs = (fd_set*)except;
if (timeout != NULL) tm = (struct timeval*)timeout;
return select(*max, rds, wts, exs, tm);
`}
end
lib/socket/socket_c.nit:396,1--412,3