Esempio n. 1
0
 public HeartbeatRequestState(HttpWebRequest request, HeartbeatData data, bool getServerUri)
 {
     Request = request;
     Data = data;
     GetServerUri = getServerUri;
 }
Esempio n. 2
0
        static void SendWoMDirectBeat()
        {
            HeartbeatData data = new HeartbeatData(WoMDirectUri);

            data.CustomData["noforward"] = "1";

            if (!RaiseHeartbeatSendingEvent(data, WoMDirectUri, false))
            {
                return;
            }
            womDirectRequest = CreateRequest(data.CreateUri());
            var state = new HeartbeatRequestState(womDirectRequest, data, false);
            womDirectRequest.BeginGetResponse(ResponseCallback, state);
        }
Esempio n. 3
0
 static void RaiseHeartbeatSentEvent(HeartbeatData heartbeatData,
                                      HttpWebResponse response,
                                      string text)
 {
     var h = Sent;
     if (h != null)
     {
         h(null, new HeartbeatSentEventArgs(heartbeatData,
                                              response.Headers,
                                              response.StatusCode,
                                              text));
     }
 }
Esempio n. 4
0
 static void SendMinecraftNetBeat()
 {
     HeartbeatData data = new HeartbeatData(MinecraftNetUri);
     if (!RaiseHeartbeatSendingEvent(data, MinecraftNetUri, true))
     {
         return;
     }
     minecraftNetRequest = CreateRequest(data.CreateUri());
     var state = new HeartbeatRequestState(minecraftNetRequest, data, true);
     minecraftNetRequest.BeginGetResponse(ResponseCallback, state);
 }
Esempio n. 5
0
 static bool RaiseHeartbeatSendingEvent(HeartbeatData data, Uri uri, bool getServerUri)
 {
     var h = Sending;
     if (h == null) return true;
     var e = new HeartbeatSendingEventArgs(data, uri, getServerUri);
     h(null, e);
     return !e.Cancel;
 }