Пример #1
0
        public IPSocketCommunicator(Socket client, FrameWrapperBase <T> _frameWrapper = null) : base()
        {
            frameWrapper   = _frameWrapper;
            socket         = client;
            clientProvided = true;

            // Do stuff
            var IP   = (client.RemoteEndPoint as IPEndPoint).Address.ToString();
            var Port = (client.RemoteEndPoint as IPEndPoint).Port;

            CommsUri = new ConnUri($"{(client.ProtocolType == ProtocolType.Tcp ? "tcp" : "udp")}://{IP}:{Port}");
            IPUInt   = HelperTools.IP2UInt(IP);

            // When client provided, persistent is forced false
            persistent = false;

            State = CommunicatorBase <T> .STATE.STOP;
        }