Microsoft.Protocols.TestTools.StackSdk.WsDiscovery.WsDiscoveryService.SendUnicast C# (CSharp) Method

SendUnicast() public method

Send unicast message
public SendUnicast ( SoapEnvelope message, string address, int port ) : void
message Microsoft.Protocols.TestTools.StackSdk.WsDiscovery.SoapMessage.SoapEnvelope The unicast message
address string Destination IP address
port int Destination port
return void
        public void SendUnicast(SoapEnvelope message, string address, int port)
        {
            if (null == message)
            {
                throw new ArgumentNullException("message", "The input parameter \"message\" is null.");
            }

            if (string.IsNullOrEmpty(address))
            {
                throw new ArgumentNullException("ipAddress", "The input parameter \"ipAddress\" is null or empty.");
            }

            if (0 == port)
            {
                throw new ArgumentNullException("ipAddress", "The input parameter \"ipAddress\" is 0.");
            }

            this.transport.SendBytes(Encoding.UTF8.GetBytes(SoapEnvelope.Serialize(message)), address, port);
        }