Class: Dizby::TCProtocol

Inherits:
Object
  • Object
show all
Includes:
BasicProtocol
Defined in:
lib/dizby/protocols/tcp.rb

Defined Under Namespace

Classes: Server

Class Method Summary collapse

Methods included from BasicProtocol

included

Class Method Details

.apply_sockopt(soc)


44
45
46
# File 'lib/dizby/protocols/tcp.rb', line 44

def apply_sockopt(soc)
  soc.setsockopt(Socket::IPPROTO_TCP, Socket::TCP_NODELAY, 1)
end

.getservername


38
39
40
41
42
# File 'lib/dizby/protocols/tcp.rb', line 38

def getservername
  Socket.gethostbyname(Socket.gethostname)[0]
rescue
  'localhost'
end