Class: Zerg::Support::Sockets::ProtocolAdapter::StateBase

Inherits:
Object
  • Object
show all
Defined in:
lib/zerg_support/sockets/protocol_adapter.rb

Overview

Base class for the adapter state.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(target) ⇒ StateBase

Returns a new instance of StateBase.



47
48
49
50
# File 'lib/zerg_support/sockets/protocol_adapter.rb', line 47

def initialize(target)
  @recv_object_buffer = []
  @target = target
end

Instance Attribute Details

#recv_object_bufferObject (readonly)

Returns the value of attribute recv_object_buffer.



46
47
48
# File 'lib/zerg_support/sockets/protocol_adapter.rb', line 46

def recv_object_buffer
  @recv_object_buffer
end

Instance Method Details

#send_bytes(data) ⇒ Object

Called by the protocol when an entire object is available.



53
54
55
# File 'lib/zerg_support/sockets/protocol_adapter.rb', line 53

def send_bytes(data)
  @target.send data, 0
end