示例#1
0
        /// <summary>
        /// Set things in motion so your service can do its work.
        /// </summary>
        protected override void OnStart(string[] args)
        {
            // TODO: Add code here to start your service.
            ep = new IPEndPoint(0, 12001);
            a  = new Acceptor(new DefaultServiceHandlerFactory());
            a.open(ep);

            a.accept();
        }
示例#2
0
        static void Main(string[] args)
        {
            ep = new IPEndPoint(0, 12003);

            a = new Acceptor(new DefaultServiceHandlerFactory());

            a.open(ep);

            a.accept();
            //wait for shutdown
            System.Threading.AutoResetEvent ev = new System.Threading.AutoResetEvent(false);

            ev.WaitOne();
        }