Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private static void runCallback()
- {
- while (true)
- {
- logInfo("Sending callback data to master server.");
- try
- {
- string json = "json={\"version\":\"" + VersionNum + "\"," +
- "\"protocol\":\"" + ProtocolVersion + "\"," +
- "\"mono\":\"" + IsMono + "\"," +
- "\"proxyPort\":\"" + config.proxyPort + "\"," +
- "\"maxSlots\":\"" + config.maxClients + "\"," +
- "\"clientCount\":\"" + clientCount + "\"}";
- byte[] buffer = Encoding.UTF8.GetBytes(json);
- WebRequest request = WebRequest.Create("http://callback.avilance.com/");
- request.ContentType = "application/x-www-form-urlencoded";
- request.Method = "POST";
- request.ContentLength = buffer.Length;
- Stream streamWriter = request.GetRequestStream();
- streamWriter.Write(buffer, 0, buffer.Length);
- streamWriter.Close();
- }
- catch (Exception e)
- {
- logDebug("Callback", e.ToString());
- }
- Thread.Sleep(1000 * 60 * 15);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement