Class: BBFS::ContentServer::RemoteContentClient
- Inherits:
-
Object
- Object
- BBFS::ContentServer::RemoteContentClient
- Defined in:
- lib/content_server/remote_content.rb
Instance Method Summary collapse
- #content_requested(addr_info, message) ⇒ Object
-
#initialize(dynamic_content_data, port) ⇒ RemoteContentClient
constructor
A new instance of RemoteContentClient.
- #tcp_thread ⇒ Object
Constructor Details
#initialize(dynamic_content_data, port) ⇒ RemoteContentClient
Returns a new instance of RemoteContentClient.
78 79 80 81 |
# File 'lib/content_server/remote_content.rb', line 78 def initialize(dynamic_content_data, port) @dynamic_content_data = dynamic_content_data @tcp_server = Networking::TCPServer.new(port, method(:content_requested)) end |
Instance Method Details
#content_requested(addr_info, message) ⇒ Object
83 84 85 86 87 |
# File 'lib/content_server/remote_content.rb', line 83 def content_requested(addr_info, ) # Send response. Log.debug1('Local content data requested.') @tcp_server.send_obj(@dynamic_content_data.last_content_data) end |
#tcp_thread ⇒ Object
89 90 91 92 |
# File 'lib/content_server/remote_content.rb', line 89 def tcp_thread return @tcp_server.tcp_thread if @tcp_server != nil nil end |