Changeset 325 for binary-improvements/MapRendering/Web/WebCommandResult.cs
- Timestamp:
- Sep 4, 2018, 1:00:48 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
binary-improvements/MapRendering/Web/WebCommandResult.cs
r309 r325 1 1 using System; 2 2 using System.Collections.Generic; 3 using System.IO; 3 4 using System.Net; 5 using System.Net.Sockets; 4 6 using System.Text; 7 using System.Threading; 8 using AllocsFixes.JSON; 9 using AllocsFixes.NetConnections.Servers.Web.API; 10 using UnityEngine; 5 11 6 using AllocsFixes.JSON; 7 using System.IO; 8 using System.Net.Sockets; 9 using System.Threading; 10 using AllocsFixes.NetConnections.Servers.Web.API; 11 12 namespace AllocsFixes.NetConnections.Servers.Web 13 { 14 public class WebCommandResult : IConsoleConnection 15 { 12 namespace AllocsFixes.NetConnections.Servers.Web { 13 public class WebCommandResult : IConsoleConnection { 16 14 public enum ResultType { 17 15 Full, … … 20 18 } 21 19 22 public static int handlingCount = 0; 23 public static int currentHandlers = 0; 24 public static long totalHandlingTime = 0; 20 public static int handlingCount; 21 public static int currentHandlers; 22 public static long totalHandlingTime; 23 private readonly string command; 24 private readonly string parameters; 25 25 26 private HttpListenerResponse response; 27 private string command; 28 private string parameters; 29 private ResultType responseType; 26 private readonly HttpListenerResponse response; 27 private readonly ResultType responseType; 30 28 31 public WebCommandResult (string _command, string _parameters, ResultType _responseType, HttpListenerResponse _response) { 29 public WebCommandResult (string _command, string _parameters, ResultType _responseType, 30 HttpListenerResponse _response) { 32 31 Interlocked.Increment (ref handlingCount); 33 32 Interlocked.Increment (ref currentHandlers); … … 65 64 result = resultObj; 66 65 } 66 67 67 WebAPI.WriteJSON (response, result); 68 68 } 69 69 } catch (IOException e) { 70 70 if (e.InnerException is SocketException) { 71 Log.Out ("Error in WebCommandResult.SendLines(): Remote host closed connection: " + e.InnerException.Message); 71 Log.Out ("Error in WebCommandResult.SendLines(): Remote host closed connection: " + 72 e.InnerException.Message); 72 73 } else { 73 74 Log.Out ("Error (IO) in WebCommandResult.SendLines(): " + e); … … 85 86 Log.Out ("WebCommandResult.SendLines(): Took {0} µs", msw.ElapsedMicroseconds); 86 87 } 88 87 89 Interlocked.Decrement (ref currentHandlers); 88 90 } … … 93 95 } 94 96 95 public void SendLog (string _msg, string _trace, UnityEngine.LogType _type) {97 public void SendLog (string _msg, string _trace, LogType _type) { 96 98 //throw new NotImplementedException (); 97 99 } 98 100 99 public void EnableLogLevel ( UnityEngine.LogType _type, bool _enable) {101 public void EnableLogLevel (LogType _type, bool _enable) { 100 102 //throw new NotImplementedException (); 101 103 } … … 106 108 } 107 109 } 108
Note:
See TracChangeset
for help on using the changeset viewer.