Class: ManagerRemoteSocketBase
- Inherits:
-
ManagerBase
- Object
- ManagerBase
- ManagerRemoteSocketBase
- Includes:
- ManagerRemoteSocketApi, ManagerRemoteSocketDisconnect, ManagerRemoteSocketHandle, ManagerRemoteSocketSessions, ManagerRemoteSocketStatistic, NetworkInterfaceHelper
- Defined in:
- lib/mrpin/core/remote/socket/base/manager_remote_socket_base.rb
Direct Known Subclasses
ManagerRemoteSocketFlash, ManagerRemoteSocketUnity, ManagerRemoteWebSockets
Instance Attribute Summary collapse
-
#ip ⇒ Object
readonly
Properties.
-
#port ⇒ Object
readonly
Returns the value of attribute port.
-
#port_secure ⇒ Object
readonly
Returns the value of attribute port_secure.
-
#sessions ⇒ Object
readonly
Returns the value of attribute sessions.
Instance Method Summary collapse
-
#initialize ⇒ ManagerRemoteSocketBase
constructor
A new instance of ManagerRemoteSocketBase.
- #on_client_request_policy(session) ⇒ Object
- #on_server_maintenance_on ⇒ Object
- #on_server_shutdown ⇒ Object
- #post_init ⇒ Object
- #start!(callback = nil) ⇒ Object
Methods included from ManagerRemoteSocketStatistic
Methods included from ManagerRemoteSocketSessions
#init_sessions, #on_client_connected, #on_client_disconnected
Methods included from ManagerRemoteSocketHandle
#handle_data_from, #requests_pending
Methods included from ManagerRemoteSocketDisconnect
#disconnect_all_with_message, #disconnect_inactive
Methods inherited from ManagerBase
#cleanup_data, #invalidate_cache, #load_init_data, #on_data_loaded, #on_server_started, #start_tasks
Constructor Details
#initialize ⇒ ManagerRemoteSocketBase
Returns a new instance of ManagerRemoteSocketBase.
61 62 63 64 65 66 67 |
# File 'lib/mrpin/core/remote/socket/base/manager_remote_socket_base.rb', line 61 def initialize super init_api init_handle init_sessions end |
Instance Attribute Details
#ip ⇒ Object (readonly)
Properties
14 15 16 |
# File 'lib/mrpin/core/remote/socket/base/manager_remote_socket_base.rb', line 14 def ip @ip end |
#port ⇒ Object (readonly)
Returns the value of attribute port.
15 16 17 |
# File 'lib/mrpin/core/remote/socket/base/manager_remote_socket_base.rb', line 15 def port @port end |
#port_secure ⇒ Object (readonly)
Returns the value of attribute port_secure.
16 17 18 |
# File 'lib/mrpin/core/remote/socket/base/manager_remote_socket_base.rb', line 16 def port_secure @port_secure end |
#sessions ⇒ Object (readonly)
Returns the value of attribute sessions.
18 19 20 |
# File 'lib/mrpin/core/remote/socket/base/manager_remote_socket_base.rb', line 18 def sessions @sessions end |
Instance Method Details
#on_client_request_policy(session) ⇒ Object
35 36 37 |
# File 'lib/mrpin/core/remote/socket/base/manager_remote_socket_base.rb', line 35 def on_client_request_policy(session) #do nothing end |
#on_server_maintenance_on ⇒ Object
49 50 51 52 53 |
# File 'lib/mrpin/core/remote/socket/base/manager_remote_socket_base.rb', line 49 def on_server_maintenance_on self.(EStringTypeBase::EST_ERROR_SERVER_ON_MAINTENANCE) nil end |
#on_server_shutdown ⇒ Object
40 41 42 43 44 45 46 |
# File 'lib/mrpin/core/remote/socket/base/manager_remote_socket_base.rb', line 40 def on_server_shutdown super (EStringTypeBase::EST_ERROR_SERVER_SHUTDOWN) nil end |
#post_init ⇒ Object
70 71 72 73 74 75 76 77 78 79 80 81 |
# File 'lib/mrpin/core/remote/socket/base/manager_remote_socket_base.rb', line 70 def post_init super register_classes register_handlers Constants::THREADS_HANDLERS_COUNT.times do |n| create_handler(n) end nil end |
#start!(callback = nil) ⇒ Object
83 84 85 86 87 88 89 90 91 92 |
# File 'lib/mrpin/core/remote/socket/base/manager_remote_socket_base.rb', line 83 def start!(callback = nil) begin descriptor_size = EventMachine.set_descriptor_table_size(60000) @logger.info "descriptors size is #{descriptor_size}" rescue Exception => e AppInfo.instance.on_server_error(e.to_s, e) end end |