public void SendResponse(LocalHost pLocalHost, EndPoint pRemoteEP) { if (!hasResponse) { return; } var _responseByteArray = Encoding.ASCII.GetBytes(responseMessage.ToCharArray()); pLocalHost.SendTo(_responseByteArray, pRemoteEP); }
public UdpServer(string pIpAddress, int pPort, ICommandFactory pCommandFactory, LogDelegate pLogDelegate) { log = pLogDelegate; try { localHost = new LocalHost(pIpAddress, pPort, RECEIVE_TIMEOUT); udpThread = new Thread(receive); started = false; stopped = false; stop = false; commandFactory = pCommandFactory; } catch { if (udpThread != null) { udpThread.Abort(); } throw; } }