Class: Rbgo::NetworkServiceFactory::Service

Inherits:
Object
  • Object
show all
Defined in:
lib/rbgo/network_service.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#hostObject

Returns the value of attribute host.



12
13
14
# File 'lib/rbgo/network_service.rb', line 12

def host
  @host
end

#portObject

Returns the value of attribute port.



12
13
14
# File 'lib/rbgo/network_service.rb', line 12

def port
  @port
end

#taskObject

Returns the value of attribute task.



13
14
15
# File 'lib/rbgo/network_service.rb', line 13

def task
  @task
end

#typeObject

Returns the value of attribute type.



12
13
14
# File 'lib/rbgo/network_service.rb', line 12

def type
  @type
end

Instance Method Details

#alive?Boolean

Returns:

  • (Boolean)


15
16
17
18
# File 'lib/rbgo/network_service.rb', line 15

def alive?
  return service_routine.alive? unless service_routine.nil?
  false
end

#stopObject



20
21
22
23
24
# File 'lib/rbgo/network_service.rb', line 20

def stop
  sockets.each do |sock|
    sock.close
  end
end