public virtual void SendPDU(byte[] PDU) { try { if (socket.Connected) { Console.WriteLine("Sending: " + PDU.ToString()); socket.BeginSend(PDU, 0, PDU.Length, SocketFlags.None, new AsyncCallback(SendCallback), socket); } else { Console.WriteLine("Socket is not connected to a SMSC"); } } catch (Exception e) { ExceptionLogger.Logg(e); Console.WriteLine("***********Exception Logged***********"); } }
private void SendCallback(IAsyncResult ar) { try { Socket clientSocket = (Socket)ar.AsyncState; int bytesSent = clientSocket.EndSend(ar); Console.WriteLine("Sent {0} bytes to SMSC", bytesSent); //clientSocket.Dispose(); } catch (Exception e) { Console.WriteLine("***********Exception Logged***********"); ExceptionLogger.Logg(e); } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)