Exemple #1
0
        public static PHandler getNext()
        {
            PHandler pHandler = null;

            _payloads.TryDequeue(out pHandler);

            return(pHandler);
        }
Exemple #2
0
        public static void Handle(byte[] payloadbytes, ConnInfo connInfo)
        {
            var payloadString = Encoding.UTF8.GetString(payloadbytes);

            if (payloadString.StartsWith("#"))
            {
                connInfo.newsCategory = payloadString.Split("#").LastOrDefault();
                Connections.Add(connInfo);
            }
            else
            {
                PHandler pHandler = JsonConvert.DeserializeObject <PHandler>(payloadString);
                PStorage.Add(pHandler);
            }

            Console.WriteLine(payloadString);
        }
Exemple #3
0
 public static void Add(PHandler pHandler)
 {
     _payloads.Enqueue(pHandler);
 }