Esempio n. 1
0
        public void sendP2pMessge(MessageP2p message)
        {
            string url = apiAddress + "/p2pMessage";

            Console.WriteLine(message.receiver);
            dynamic str = WebApi.Post(url, JsonConvert.SerializeObject(message));

            reciveStatus?.Invoke(convertData(str));
        }
 public void sendP2pMessge(MessageP2p message)
 {
     try
     {
         socket.Emit("p2p", JsonConvert.SerializeObject(message));
     }
     catch (Exception ex)
     {
         string url = apiAddress + "/p2pMessage";
         Console.WriteLine(message.receiver);
         dynamic  str = WebApi.Post(url, JsonConvert.SerializeObject(message));
         Response res = JsonConvert.DeserializeObject <Response>(str);
         reciveMessage?.Invoke(res.message);
     }
 }