Esempio n. 1
0
        /// <summary>
        /// Uses TMQ Protocol and accepts TCP connections.
        /// </summary>
        public static ITwinoServer UseTmq(this ITwinoServer server, IProtocolConnectionHandler <TmqServerSocket, TmqMessage> handler)
        {
            TwinoTmqProtocol protocol = new TwinoTmqProtocol(server, handler);

            server.UseProtocol(protocol);
            return(server);
        }
Esempio n. 2
0
        /// <summary>
        /// Uses TMQ Protocol and accepts TCP connections.
        /// </summary>
        public static ITwinoServer UseTmq(this ITwinoServer server, TmqMessageHandler action)
        {
            TmqMethodHandler handler  = new TmqMethodHandler(action);
            TwinoTmqProtocol protocol = new TwinoTmqProtocol(server, handler);

            server.UseProtocol(protocol);
            return(server);
        }