Class: ContentServer::RemoteContentServer
- Inherits:
-
Object
- Object
- ContentServer::RemoteContentServer
- Defined in:
- lib/content_server/remote_content.rb
Instance Method Summary collapse
- #content_requested(addr_info, message) ⇒ Object
-
#initialize(dynamic_content_data, port) ⇒ RemoteContentServer
constructor
A new instance of RemoteContentServer.
- #tcp_thread ⇒ Object
Constructor Details
#initialize(dynamic_content_data, port) ⇒ RemoteContentServer
Returns a new instance of RemoteContentServer.
74 75 76 77 78 |
# File 'lib/content_server/remote_content.rb', line 74 def initialize(dynamic_content_data, port) @dynamic_content_data = dynamic_content_data @tcp_server = Networking::TCPServer.new(port, method(:content_requested)) Log.debug3("initialize RemoteContentServer on port:#{port}") end |
Instance Method Details
#content_requested(addr_info, message) ⇒ Object
80 81 82 83 84 85 86 |
# File 'lib/content_server/remote_content.rb', line 80 def content_requested(addr_info, ) # Send response. Log.info("Content server received content data request") Log.debug1("Sending content data:#{@dynamic_content_data.last_content_data}") @tcp_server.send_obj(@dynamic_content_data.last_content_data) Log.info('Content server sent content data') end |
#tcp_thread ⇒ Object
88 89 90 91 |
# File 'lib/content_server/remote_content.rb', line 88 def tcp_thread return @tcp_server.tcp_thread if @tcp_server != nil nil end |