class SSLGate::RawClient

Attributes

queue[R]

Public Class Methods

new(q, parent) click to toggle source
# File lib/ssl_gate/raw_gate.rb, line 8
def initialize(q, parent)
  set_sock_opt(Socket::IPPROTO_TCP, Socket::TCP_NODELAY, 1) # Nagle off

  @parent = parent
  @queue = q

  cb = proc do |msg|
    msg ? send_data(msg) : close_connection
    q.pop(&cb)
  end
  q.pop(&cb)
end

Public Instance Methods

receive_data(data) click to toggle source
# File lib/ssl_gate/raw_gate.rb, line 21
def receive_data(data)
  @parent.send_data data
end
unbind() click to toggle source
# File lib/ssl_gate/raw_gate.rb, line 25
def unbind
  @parent.close_connection
end