public void Start(EnumSessionType sessionType, int port, string moduleIdentifier = null) { _sessionType = sessionType; _moduleIdentifier = moduleIdentifier; //Setup Listener var ipEndPoint = new IPEndPoint(IPAddress.Any, port); _listenerSocket = new System.Net.Sockets.Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp); _listenerSocket.Bind(ipEndPoint); _listenerSocket.Listen(10); _listenerSocket.BeginAccept(OnNewConnection, this); }
} // end CreateTransaction /// <summary> /// Toolkit internal creator of a <see cref="DaSession"/>. By overloading this method, the user can determine creation of custom Session objects. /// The number of connected clients can be limited. This can be achieved by returning null instead of a new instance of the DaSession class if the /// number of clients exceeds a desired number. /// </summary> /// <param name="aType"></param> /// <param name="aHandle"></param> /// <returns></returns> /// <include /// file='TBNS.doc.xml' /// path='//class[@name="Creator"]/ /// method[@name="CreateSession"]/doc/*' /// /> public virtual DaSession CreateSession( EnumSessionType aType, uint aHandle) { return new DaSession(aType, aHandle); } // end CreateSession
public MySession(EnumSessionType aType, uint aHandle) : base(aType, aHandle) { m_clientSpecValue = new ValueQT(s_clientCount, EnumQuality.GOOD, DateTime.Now); ClientNameChanged += new SessionClientNameChanged(HandleClientNameChanged); s_clientCount++; } // end ctr
//----------------------------- /// <summary> /// Default session constructor /// </summary> /// <param name="aType"> /// the type of the client session /// </param> /// <param name="aHandle"> /// OTB internal session identifier. /// </param> /// <include /// file='TBNS.doc.xml' /// path='//class[@name="DaSession"]/ /// ctor[@name="DaSession"]/doc/*' /// /> public DaSession(EnumSessionType aType, uint aHandle) { m_type = aType; m_objectHandle = aHandle; } // end ctr
} // end CreateRequest public override DaSession CreateSession(EnumSessionType aType, uint aHandle) { return(new MySession(aType, aHandle)); } // end CreateSession
public static ErrorCode CreateSession(string name, int serverID, int worldID, int numSlots, string password, FlagSessionCreate creationFlags, EnumSessionType sessionType, string ps4SessionStatus) { return(new ErrorCode()); }