Ejemplo n.º 1
0
 public HeartbeatRequestState(HttpWebRequest request, HeartbeatData data, bool getServerUri)
 {
     Request = request;
     Data = data;
     GetServerUri = getServerUri;
 }
Ejemplo 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);
        }
Ejemplo 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));
     }
 }
Ejemplo 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);
 }
Ejemplo 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;
 }