Beispiel #1
0
        protected BasicSocket(IPAddress ip, SocketType socketType, SocketSide socketSide, SocketEventProvider eventProvider)
        {
            IP       = ip;
            SockType = socketType;
            SockSide = socketSide;
            (EventProvider = eventProvider).ProcessHandler += EventProvider_ProcessHandler;

            ReUse();
        }
Beispiel #2
0
        protected SenderSocket(IPAddress ip, SocketType socketType, SocketSide socketSide, SocketEventProvider eventProvider)
            : base(ip, socketType, socketSide, eventProvider)
        {
            Pack = new Packet();

            if (socketType == SocketType.Stream && socketSide == SocketSide.Server)
            {
                TcpClientSockets = new List <SenderSocket>();
            }
        }
Beispiel #3
0
        public static SenderSocket Create(IPAddress ip, SocketSide socketSide, SocketEventProvider eventProvider)
        {
            switch (socketSide)
            {
            default:
            case SocketSide.Server:
                return(new TcpServerSocket(ip, eventProvider));

            case SocketSide.Client:
                return(new TcpClientSocket(ip, eventProvider));
            }
        }
Beispiel #4
0
 public UdpSocketProvider(IPAddress ip, SocketSide socketSide)
 {
     Sender = new UdpSocket(ip, socketSide, EventProvider);
 }
Beispiel #5
0
 public TcpReceiveSocket(Socket socket, SocketSide socketSide, SocketEventProvider eventProvider) :
     base(((IPEndPoint)socket.RemoteEndPoint).Address, SocketType.Stream, socketSide, eventProvider)
 {
     Sock = socket;
 }
Beispiel #6
0
 public UdpSocket(IPAddress ip, SocketSide socketSide, SocketEventProvider eventProvider)
     : base(ip, SocketType.Dgram, socketSide, eventProvider)
 {
 }
Beispiel #7
0
 public TcpSocketProvider(IPAddress ip, SocketSide socketSide)
 {
     Sender = TcpSocketFactory.Create(ip, socketSide, EventProvider);
 }