Exemple #1
0
        protected override TransportMessage NewTransport(string uri, Resources resources)
        {
            UdpListener udpListener = resources.Get(UDP_LISTENER) as UdpListener;
            IPEndPoint  ipEndPoint  = resources.Get(SOCKET_ADDRESS) as IPEndPoint;

            URL             url             = new URL(uri);
            TransportPacket transportPacket = null;

            if (udpListener != null)
            {
                transportPacket = new UdpConnection(ipEndPoint, udpListener);
            }
            else
            {
                transportPacket = new UdpConnection(url);
            }

            TransportMessage transportMessage = new Messagizer(transportPacket, url, resources);

            transportMessage = AddFilters(transportMessage, url, resources);

            ValueFactory vf = (ValueFactory)resources.Get(TransportConsts.VALUE_FACTORY);

            vf.LockDynamicTypes();

            return(transportMessage);
        }
Exemple #2
0
        protected override TransportMessage NewTransport(string uri, Resources resources)
        {
            URL u = new URL(uri);

            Object socket = resources.Get(SOCKET);

            TransportData c;

            if (isSecure)
            {
                c = new TlsConnection((Socket)socket, u, resources);
            }
            else
            {
                c = new TcpConnection((Socket)socket, u, resources);
            }

            TransportPacket p = new Packetizer(c, u, resources);

            TransportMessage m = new Messagizer(p, u, resources);

            m = AddFilters(m, u, resources);

            //MailboxManager r = new PlainMailboxManager(m, u, resources);

            //DeliveryService d = new DefaultDeliveryService(r, u, resources);

            ValueFactory vf = (ValueFactory)resources.Get(TransportConsts.VALUE_FACTORY);

            vf.LockDynamicTypes();

            return(m);
        }
Exemple #3
0
        public void SetUpBeforeClass()
        {
            vf = new MyValueFactory();
            ps = new MyPacketSource();
            mh = new MyMessageHandler();
            Resources res = new Resources();

            res.Add(TransportConsts.VALUE_FACTORY, vf);
            m = new Messagizer(ps, "foo:?Messagizer.format=binary", res);
            m.SetSession(mh);
            Console.WriteLine();
            Console.Write("TestMessagizer");
        }