Class: Evma::Protocol

Inherits:
Object
  • Object
show all
Defined in:
lib/evma/protocol.rb

Direct Known Subclasses

DatagramProtocol, ProtocolFactory, StreamProtocol

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(sig) ⇒ Protocol

Returns a new instance of Protocol.



31
32
33
# File 'lib/evma/protocol.rb', line 31

def initialize sig
  @signature = sig
end

Instance Attribute Details

#signatureObject (readonly)

Returns the value of attribute signature.



29
30
31
# File 'lib/evma/protocol.rb', line 29

def signature
  @signature
end

Instance Method Details

#closeObject



38
39
40
41
# File 'lib/evma/protocol.rb', line 38

def close
  Evma::Reactor.instance # ensure initialized
  EventMachine.close_connection signature, false
end

#close_after_writingObject



43
44
45
46
# File 'lib/evma/protocol.rb', line 43

def close_after_writing
  Evma::Reactor.instance # ensure initialized
  EventMachine.close_connection signature, true
end

#unbindObject



35
36
# File 'lib/evma/protocol.rb', line 35

def unbind
end