class Miniss::Socket
- Miniss::Socket
- Reference
- Object
Overview
Socket object, having several properties.
Example:
so = Miniss::Socket.new(:tcp, 4_u8)
line = File.readlines("/proc/net/tcp")[1]
so.parse_line(line)
so.laddr # => "127.0.0.53:53"
so.state # => "LISTEN"
so.uname # => "systemd-resolve"
so.uid # => 980
Defined in:
miniss/addr.crConstructors
-
.new(type : Symbol, ipv : UInt8)
Initialize
Socket
class.
Instance Method Summary
-
#ipv : UInt8
IP version (v4, v6).
-
#laddr : String
Local address (IP + port).
-
#laddr=(laddr : String)
Local address (IP + port).
-
#parse_line(line : String) : Nil
Parse a socket line from
/proc/net/XXX
and setSocket
instance properties. -
#raddr : String
Remote address (IP + port).
-
#raddr=(raddr : String)
Remote address (IP + port).
-
#state : String
Socket state cf.
-
#state=(state : String)
Socket state cf.
-
#type : Symbol
Socket type (TCP, UDP).
-
#uid : UInt32
Process owner user ID.
-
#uid=(uid : UInt32)
Process owner user ID.
-
#uname : String
Process owner user name.
-
#uname=(uname : String)
Process owner user name.