Method: SpinalTap::ClientHelpers#setup

Defined in:
lib/spinal_tap/client_helpers.rb

#setup(server) ⇒ Object



9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/spinal_tap/client_helpers.rb', line 9

def setup(server)
  @server = server
  @history = SpinalTap::History.new
  @binding = SpinalTap::BindingWrapper.new.binding

  reset_cmd_line

  setsockopt(Socket::IPPROTO_TCP, Socket::TCP_NODELAY, 1)

  suppress_go_ahead = [255, 251, 3].pack('C3')
  write(suppress_go_ahead)

  echo = [255, 251, 1].pack('C3')
  write(echo)

  6.times { getc }
end