public override void Send(IPEndPoint destinationEndPoint, byte[] buffer)
{
if (destinationEndPoint.ToString() != m_remoteEndPoint.ToString())
{
throw new ApplicationException("The SilverlightTCPSIPChannel can only send to a single server socket. The current connection is to " + m_remoteEndPoint + ", the request to send was to " + destinationEndPoint + ".");
}
else if (!m_isConnected)
{
throw new ApplicationException("The SilverlightTCPSIPChannel cannot send as it is in a disconnected state.");
}
try
{
SocketAsyncEventArgs sendArgs = new SocketAsyncEventArgs();
sendArgs.SetBuffer(buffer, 0, buffer.Length);
m_socket.SendAsync(sendArgs);
}
catch (Exception excp)
{
logger.Error("Exception SilverlightTCPSIPChannel Send. " + excp.Message);
SIPSocketDisconnected(m_remoteEndPoint);
}
}