private void Awake() { _logList = new Queue <string>(); _connection = new UDPThreaded(); _connection.StartConnection(sendIp, sendPort, receivePort); hasConnection = false; postRequest = false; }
void Start() { string sendIp = "127.0.0.1"; int sendPort = 9200; int receivePort = 10001; connection = new UDPThreaded(); connection.StartConnection(sendIp, sendPort, receivePort); }
/* * This function will send all logs within the logList while emptying the queue in the process. * These logs are sent to the Logstash Client running on the server end. */ public static Queue <string> PostAllLogs(UDPThreaded Connection, Queue <string> LogList) { if (DataAnalyticsStructure.GetPostRequestState() && DataAnalyticsStructure.GetConnectedState() && LogList != null && LogList.Count >= 1) { while (LogList.Count > 0 && Connection != null) { Connection.Send(LogList.Dequeue()); } } return(LogList); }