Class: Mu::Pcap::IOPair
- Inherits:
-
Object
- Object
- Mu::Pcap::IOPair
- Defined in:
- lib/diy/parser/mu/pcap/io_pair.rb
Overview
For emulating of a pair of connected sockets. Bytes written with #write to one side are returned by a subsequent #read on the other side.
Use Pair.stream_pair to get a pair with stream semantics. Use Pair.packet_pair to get a pair with packet semantics.
Defined Under Namespace
Instance Attribute Summary collapse
-
#other ⇒ Object
Returns the value of attribute other.
-
#read_queue ⇒ Object
readonly
Returns the value of attribute read_queue.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize ⇒ IOPair
constructor
A new instance of IOPair.
- #write(bytes) ⇒ Object
Constructor Details
#initialize ⇒ IOPair
Returns a new instance of IOPair.
18 19 20 |
# File 'lib/diy/parser/mu/pcap/io_pair.rb', line 18 def initialize raise NotImplementedError end |
Instance Attribute Details
#other ⇒ Object
Returns the value of attribute other.
16 17 18 |
# File 'lib/diy/parser/mu/pcap/io_pair.rb', line 16 def other @other end |
#read_queue ⇒ Object (readonly)
Returns the value of attribute read_queue.
15 16 17 |
# File 'lib/diy/parser/mu/pcap/io_pair.rb', line 15 def read_queue @read_queue end |
Class Method Details
Instance Method Details
#write(bytes) ⇒ Object
38 39 40 41 |
# File 'lib/diy/parser/mu/pcap/io_pair.rb', line 38 def write bytes @other.read_queue << bytes bytes.size end |