123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using SuperSocket.SocketBase;
- using SuperSocket.SocketBase.Provider;
- using SuperSocket.SocketBase.Config;
- using System.Reflection;
- using SuperSocket.SocketBase.Metadata;
- namespace SuperSocket.SocketEngine
- {
- class MarshalAppServer : MarshalByRefObject, IWorkItem, IStatusInfoSource
- {
- private IWorkItem m_AppServer;
-
-
-
-
- public MarshalAppServer(string serviceTypeName)
- {
- var serviceType = Type.GetType(serviceTypeName);
- m_AppServer = (IWorkItem)Activator.CreateInstance(serviceType);
- }
-
-
-
- public string Name
- {
- get { return m_AppServer.Name; }
- }
-
-
-
-
-
-
-
- public bool Setup(IBootstrap bootstrap, IServerConfig config, ProviderFactoryInfo[] factories)
- {
- return m_AppServer.Setup(bootstrap, config, factories);
- }
-
-
-
-
-
-
- public IServerConfig Config
- {
- get
- {
- if(m_AppServer == null)
- return null;
- return m_AppServer.Config;
- }
- }
-
-
-
-
-
- public void ReportPotentialConfigChange(IServerConfig config)
- {
- m_AppServer.ReportPotentialConfigChange(config);
- }
-
-
-
-
-
-
- public bool Start()
- {
- return m_AppServer.Start();
- }
-
-
-
- public void Stop()
- {
- m_AppServer.Stop();
- }
-
-
-
-
-
-
- public ServerState State
- {
- get { return m_AppServer.State; }
- }
-
-
-
- public int SessionCount
- {
- get { return m_AppServer.SessionCount; }
- }
- StatusInfoAttribute[] IStatusInfoSource.GetServerStatusMetadata()
- {
- return m_AppServer.GetServerStatusMetadata();
- }
- StatusInfoCollection IStatusInfoSource.CollectServerStatus(StatusInfoCollection nodeStatus)
- {
- return m_AppServer.CollectServerStatus(nodeStatus);
- }
- public void TransferSystemMessage(string messageType, object messageData)
- {
- m_AppServer.TransferSystemMessage(messageType, messageData);
- }
-
-
-
-
-
-
-
-
-
- [Obsolete]
- public override object InitializeLifetimeService()
- {
- return null;
- }
- }
- }
|