SIPSorcery.Net.STUNListener.Send C# (CSharp) Method

Send() public method

public Send ( IPEndPoint destinationEndPoint, byte buffer ) : void
destinationEndPoint System.Net.IPEndPoint
buffer byte
return void
        public virtual void Send(IPEndPoint destinationEndPoint, byte[] buffer)
        {
            try
            {
                if(destinationEndPoint == null)
                {
                    logger.Error("An empty destination was specified to Send in STUNListener.");
                }

                m_stunConn.Send(buffer, buffer.Length, destinationEndPoint);
            }
            catch(ObjectDisposedException)
            {
                logger.Warn("The STUNListener was not accessible when attempting to send a message to, " + IPSocket.GetSocketString(destinationEndPoint) + ".");
            }
            catch(Exception excp)
            {
                logger.Error("Exception (" + excp.GetType().ToString() + ") STUNListener Send (sendto=>" + IPSocket.GetSocketString(destinationEndPoint) + "). " + excp.Message);
                throw excp;
            }
        }