Class: Shadowsocks::Local::DirectConnector

Inherits:
Tunnel
  • Object
show all
Defined in:
lib/shadowsocks/local.rb

Constant Summary

Constants inherited from Connection

Connection::BackpressureLevel

Instance Attribute Summary

Attributes inherited from Tunnel

#server

Attributes inherited from Connection

#crypto

Instance Method Summary collapse

Methods inherited from Tunnel

#initialize, #remote, #unbind

Constructor Details

This class inherits a constructor from Shadowsocks::Tunnel

Instance Method Details

#post_initObject



22
23
24
25
26
27
28
# File 'lib/shadowsocks/local.rb', line 22

def post_init
  p "connecting #{server.remote_addr[3..-1]} directly"
  server.cached_pieces.each { |piece| send_data piece }
  server.cached_pieces = []

  server.stage = 5
end

#receive_data(data) ⇒ Object



30
31
32
33
# File 'lib/shadowsocks/local.rb', line 30

def receive_data data
  server.send_data data
  outbound_scheduler
end