SocketObserver
socket :: SocketSet :: defaultinit
core :: Object :: class_factory
Implementation used byget_class
to create the specific class.
socket :: SocketSet :: defaultinit
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).
# A simple set of sockets used by `SocketObserver`
class SocketSet
private var native = new NativeSocketSet
init do clear
# Add `socket` to this set
fun add(socket: Socket) do native.set(socket.native)
# Remove `socket` from this set
fun remove(socket: Socket) do native.clear(socket.native)
# Does this set has `socket`?
fun has(socket: Socket): Bool do return native.is_set(socket.native)
# Clear all sockets from this set
fun clear do native.zero
end
lib/socket/socket.nit:290,1--307,3