Class: SysVIPC::MessageQueue
Instance Attribute Summary collapse
-
#msgid ⇒ Object
readonly
Returns the value of attribute msgid.
Instance Method Summary collapse
-
#ipc_rmid ⇒ Object
(also: #rm)
Remove.
-
#ipc_set(msqid_ds) ⇒ Object
(also: #msqid_ds=)
Set the Msqid_ds object.
-
#ipc_stat ⇒ Object
(also: #msqid_ds)
Return the Msqid_ds object.
-
#rcv(type, size, flags = 0) ⇒ Object
(also: #receive)
Receive a message of type
type
, limited tolen
bytes or fewer. -
#snd(type, text, flags = 0) ⇒ Object
(also: #send)
Send a message with type
type
and texttext
.
Methods included from SysVIPC
Instance Attribute Details
#msgid ⇒ Object (readonly)
Returns the value of attribute msgid.
120 121 122 |
# File 'lib/SysVIPC.rb', line 120 def msgid @msgid end |
Instance Method Details
#ipc_rmid ⇒ Object Also known as: rm
Remove. See msgctl(2).
144 145 146 |
# File 'lib/SysVIPC.rb', line 144 def ipc_rmid check_result(msgctl(@msgid, IPC_RMID, nil)) end |
#ipc_set(msqid_ds) ⇒ Object Also known as: msqid_ds=
Set the Msqid_ds object. See msgctl(2).
133 134 135 136 137 138 139 |
# File 'lib/SysVIPC.rb', line 133 def ipc_set(msqid_ds) unless Msqid_ds === msqid_ds raise ArgumentError, "argument to ipc_set must be a Msqid_ds" end check_result(msgctl(@msgid, IPC_SET, msqid_ds)) end |
#ipc_stat ⇒ Object Also known as: msqid_ds
Return the Msqid_ds object. See msgctl(2).
124 125 126 127 128 |
# File 'lib/SysVIPC.rb', line 124 def ipc_stat res, msqid_ds = msgctl(@msgid, IPC_STAT) check_result(res) msqid_ds end |
#rcv(type, size, flags = 0) ⇒ Object Also known as: receive
Receive a message of type type
, limited to len
bytes or fewer. See msgrcv(2).
159 160 161 162 163 |
# File 'lib/SysVIPC.rb', line 159 def rcv(type, size, flags = 0) res, mtype, mtext = msgrcv(@msgid, size, type, flags) check_result(res) mtext end |
#snd(type, text, flags = 0) ⇒ Object Also known as: send
Send a message with type type
and text text
. See msgsnd(2).
151 152 153 |
# File 'lib/SysVIPC.rb', line 151 def snd(type, text, flags = 0) check_result(msgsnd(@msgid, type, text, flags)) end |