public void InitUdpSocket(bool useListen) { if (udpSocket == null) { try { udpSocket = new UdpSocket(); udpSocket.UdpSocketInit(0, Config.BUFFER_SIZE * 2, string.Format("FAX_{0}_PSO_{1}_UdpSocket", Config.SYSTEM_NO, Config.PROCESS_NO), useListen); udpSocket.OnSent += new UdpSocket.UdpMessageSentEventHandler(UdpMessage_OnSent); udpSocket.OnReceived += new UdpSocket.UdpMessageReceivedEventHandler(UdpMessage_OnReceived); udpSocket.OnRaisedError += new UdpSocket.UdpMessageRaisedErrorEventHandler(UdpMessage_OnRaisedError); } catch (Exception ex) { udpSocket.LogWriteErr(ex, "UdpSingle()", "InitUdpSocket()"); } } }