Beispiel #1
0
        /// <summary>
        /// Uses HMQ Protocol and accepts TCP connections.
        /// </summary>
        public static IHorseServer UseHmq(this IHorseServer server, IProtocolConnectionHandler <HorseServerSocket, HorseMessage> handler)
        {
            HorseMqProtocol protocol = new HorseMqProtocol(server, handler);

            server.UseProtocol(protocol);
            return(server);
        }
Beispiel #2
0
        /// <summary>
        /// Uses HMQ Protocol and accepts TCP connections.
        /// </summary>
        public static IHorseServer UseHmq(this IHorseServer server, HorseMessageHandler action)
        {
            HorseMethodHandler handler  = new HorseMethodHandler(action);
            HorseMqProtocol    protocol = new HorseMqProtocol(server, handler);

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