Used in one of the out parameters of UDPSocket::recv_from
.
socket $ SocketAddress :: SELF
Type of this instance, automatically specialized in every classsocket $ SocketAddress :: finalize_once
Real finalization method ofFinalizableOnce
, will be called only once
socket $ SocketAddress :: init
core :: Object :: class_factory
Implementation used byget_class
to create the specific class.
socket :: SocketAddress :: defaultinit
core :: Object :: defaultinit
core :: FinalizableOnce :: defaultinit
core :: Finalizable :: defaultinit
core :: Finalizable :: finalize
Liberate any resources held byself
before the memory holding self
is freed
core :: FinalizableOnce :: finalize_once
Real finalization method ofFinalizableOnce
, will be called only once
core :: FinalizableOnce :: finalized
Hasself
been finalized? (either by the GC or an explicit call to finalize
)
core :: FinalizableOnce :: finalized=
Hasself
been finalized? (either by the GC or an explicit call to finalize
)
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).
# Address of a socket in the Internet namespace
#
# Used in one of the out parameters of `UDPSocket::recv_from`.
class SocketAddress
super FinalizableOnce
# FIXME make init private
private var native: NativeSocketAddrIn
init
do
address = native.address.to_s
port = native.port
end
# Internet address
var address: String is noinit
# Port of the socket
var port: Int is noinit
redef fun ==(o) do return o isa SocketAddress and o.address == address and o.port == port
redef fun finalize_once do native.free
end
lib/socket/socket.nit:467,1--492,3