示例#1
0
        public StompSource(PacketConverter <T> packetConverter, string serverPortTopic) : base(packetConverter)
        {
            string server = "localhost";
            int    port   = StompConnection.DEFAULT_PORT;
            string topic  = packetConverter.GetDefaultTopic(true);

            PacketSource <T> .ParseServerPortTopic(serverPortTopic, ref server, ref port, ref topic);

            // Create STOMP connection
            stompConnection = null;
            try
            {
                stompConnection = new StompConnection(server, port);
            }
            catch (Exception) {; }

            if (stompConnection != null)
            {
                // Subscribe to a topic
                stompConnection.Subscribe(topic);

                // Create threaded listener and add a message handler
                stompListener = new StompListener(stompConnection);
                stompListener.ReceivedMessage += stompListener_ReceivedMessage;
            }
        }
示例#2
0
        public OscDest(PacketConverter <T> packetConverter, string serverPortTopic) : base(packetConverter)
        {
            string server = OscReceiver.DEFAULT_INTERFACE;
            int    port   = OscReceiver.DEFAULT_PORT;
            string topic  = packetConverter.GetDefaultTopic(false);

            PacketSource <T> .ParseServerPortTopic(serverPortTopic, ref server, ref port, ref topic);

            oscTransmitter = new OscTransmitter(server, port);
            this.topic     = topic;
        }
示例#3
0
        public StompDest(PacketConverter <T> packetConverter, string serverPortTopic) : base(packetConverter)
        {
            string server = "localhost";
            int    port   = StompConnection.DEFAULT_PORT;
            string topic  = packetConverter.GetDefaultTopic(false);

            PacketSource <T> .ParseServerPortTopic(serverPortTopic, ref server, ref port, ref topic);

            this.topic = topic;

            // Create STOMP connection
            stompConnection = null;
            try
            {
                stompConnection = new StompConnection(server, port);
            }
            catch (Exception) {; }
        }
示例#4
0
        public OscSource(PacketConverter <T> packetConverter, string serverPortTopic) : base(packetConverter)
        {
            string server = OscReceiver.DEFAULT_INTERFACE;
            int    port   = OscReceiver.DEFAULT_PORT;
            string topic  = packetConverter.GetDefaultTopic(false);

            PacketSource <T> .ParseServerPortTopic(serverPortTopic, ref server, ref port, ref topic);

            this.topic = topic;

            // Create OSC connection
            OscReceiver oscReceiver = null;

            try
            {
                oscReceiver = new OscReceiver(port);        // OscReceiver.DEFAULT_PORT
                oscReceiver.ReceivedBundle  += oscReceiver_ReceivedBundle;
                oscReceiver.ReceivedMessage += oscReceiver_ReceivedMessage;
                oscReceiver.Start();
            }
            catch (Exception) {; }
        }