Esempio n. 1
0
 public void BindAsync(LazynetSocketEvent socketEvent)
 {
     if (this.Socket is null)
     {
         throw new Exception("请先create socket, 再调用此方法");
     }
     this.SocketEvent = socketEvent;
     this.Socket.SetEvent(new LazynetDefaultSocketEvent(this));
     this.Socket.BindAsync();
 }
Esempio n. 2
0
        public void BindAsync(string activeEvent, string inactiveEvent, string readEvent, string exceptionEvent)
        {
            LazynetSocketEvent socketEvent = new LazynetSocketEvent()
            {
                ActiveEvent    = activeEvent,
                ExceptionEvent = exceptionEvent,
                InactiveEvent  = inactiveEvent,
                ReadEvent      = readEvent
            };

            ServiceContext.BindAsync(socketEvent);
        }