All pastes #750018 Raw Edit

Untitled

public text v1 · immutable
#750018 ·published 2007-10-26 04:05 UTC
rendered paste body
        public virtual void Start()
        {
            this.Start(-1);
        }

        public void Start(int backlog)
        {
            this.mSock.Bind(this.ipInfo);
            this.mSock.Listen(backlog);
            this.isListening = true;
            this.mSock.BeginAccept(this.onClientConnectCallback, this.mSock);

            this.PerformStart();
        }

        protected virtual void PerformStart()
        {

        }

        public void Stop()
        {
            this.mSock.Shutdown(SocketShutdown.Both);
            this.mSock.Close(5);
            this.isListening = false;

            this.PerformStop();
        }

        protected virtual void PerformStop()
        {

        }