コード例 #1
0
        public Session(ClientPipe clientPipe, ServerPipe serverPipe)
        {
            this.Timers = new SessionTimers();
            this.Timers.ClientConnected = DateTime.Now;

            this.Flags = new StringDictionary();
            if (clientPipe != null)
            {
                this.clientIP = (clientPipe.Address == null) ? null : clientPipe.Address.ToString();
                this.clientPort = clientPipe.Port;
                this.Flags["x-clientIP"] = this.clientIP;
                this.Flags["x-clientport"] = this.clientPort.ToString();
                if (clientPipe.LocalProcessID != 0)
                {
                    this._localProcessID = clientPipe.LocalProcessID;
                    this.Flags["x-ProcessInfo"] = string.Format("{0}:{1}", clientPipe.LocalProcessName, this._localProcessID);
                    this._localProcessName = clientPipe.LocalProcessName;
                }
            }
            this.Response = new ServerChatter(this);
            this.Request = new ClientChatter(this);
            this.Request.ClientPipe = clientPipe;
            this.Response.ServerPipe = serverPipe;
        }
コード例 #2
0
        public static void CreateAndExecute(object param)
        {
            ClientPipe clientPipe = new ClientPipe((Socket)param);
            Session session = new Session(clientPipe, null);

            session.Execute();
        }