Beispiel #1
0
        protected virtual Socket CreateSocket(IPcb pcb)
        {
            if (pcb == null)
            {
                return(null);
            }

            return(new Socket(pcb));
        }
Beispiel #2
0
 public Socket(IPcb pcb)
 {
     this.m_poPCB        = pcb ?? throw new ArgumentNullException(nameof(pcb));
     this.m_poPCB.Open  += (sender, e) => this.OnOpen(e);
     this.m_poPCB.Abort += (sender, e) =>
     {
         this.OnAbort(e);
         this.Close();
     };
     this.m_poPCB.Message += (sender, e) => this.OnMessage(e);
 }
Beispiel #3
0
 public virtual Socket EndAccept(IPcb pcb)
 {
     return(CreateSocket(pcb));
 }
Beispiel #4
0
 public virtual bool BeginAccept(IPcb pcb)
 {
     return(pcb != null);
 }