コード例 #1
0
 void Listen(string ip, UInt32 port, ISSClientSessionHandler _handler, ICoder _coder, int listen_max_count)
 {
     _handler.Init();
     handler = _handler;
     coder   = _coder;
     Net.Instance.Listen(ip, port, this, listen_max_count);
 }
コード例 #2
0
    public UInt64 Connect(string _host, UInt32 _port, ISSClientSessionHandler _handler, ICoder _coder)
    {
        _handler.Init();

        SSClientSession session = (SSClientSession)CreateSession();

        session.SetHandler(_handler);
        session.SetCoder(_coder);
        session.SetConnectType();

        ConnectCache cache = new ConnectCache(session.GetSessID(), _host, _port, Util.GetMillSecond() + mgr_beat_heart_max_time);

        connect_cache_dict[session.GetSessID()] = cache;
        Log.InfoAf("[SSClientSessionMgr] ConnectCache Add SessionID={0},Host={1} Port={2}", session.GetSessID(), _host, _port);

        Net.Instance.Connect(_host, _port, session);
        return(session.GetSessID());
    }
コード例 #3
0
 public void SetHandler(ISSClientSessionHandler _handler)
 {
     handler = _handler;
 }