Class: NFS::SUNRPC::Server

Inherits:
Object
  • Object
show all
Defined in:
lib/nfs/sunrpc/server.rb

Direct Known Subclasses

TCPServer, UDPServer

Instance Method Summary collapse

Instance Method Details

#hostObject



4
5
6
# File 'lib/nfs/sunrpc/server.rb', line 4

def host
  @server.addr[2]
end

#joinObject



12
13
14
15
16
# File 'lib/nfs/sunrpc/server.rb', line 12

def join
  if !@thread.nil?
    @thread.join
  end
end

#portObject



8
9
10
# File 'lib/nfs/sunrpc/server.rb', line 8

def port
  @server.addr[1]
end

#shutdownObject



24
25
26
27
28
29
# File 'lib/nfs/sunrpc/server.rb', line 24

def shutdown
  Thread.kill(@thread)
  @thread = nil
  @server.shutdown
rescue Errno::ENOTCONN
end

#startObject



18
19
20
21
22
# File 'lib/nfs/sunrpc/server.rb', line 18

def start
  if @thread.nil?
    @thread.start
  end
end