Sets/Returns the IP Address of a Network Interface Card (NIC) to receive unsolicited messages on.
Dotted-decimal string (e.g "192.168.1.4")
This property is useful when you have multiple network cards in your PC and you want to receive unsolicited messages on specific network cards. Setting this property to an empty string ("") will receive unsolicited messages on any installed network card (default).
Changing this property after the Listen method is called will have no affect.
| Exception Type | Condition |
|---|---|
| ArgumentNullException | Thrown if IPAddress set to a null reference (Nothing in Visual Basic) |
| ArgumentOutOfRangeException | Thrown if IPAddress.Length is less than 6 characters. |
VB Try ' ******************************* ' * initialize PeerMessage class Dim peerMsg as New PeerMessage() ' ******************************* ' * use NIC with IP Address peerMsg.IPAddressNIC = "192.168.1.4" ' ******************************* ' * listen for unsolicited messages peerMsg.Listen() Catch ex As System.Exception Console.WriteLine(ex.Message) End Try C# try { /////////////////////////////////// // initialize controller class PeerMessage peerMsg = new PeerMessage(); /////////////////////////////////// // use NIC with IP address peerMsg.IPAddressNIC = "192.168.1.4"; ////////////////////////////////// // listen for unsolicited messages peerMsg.Listen(); } catch(System.Exception ex) { Console.WriteLine(ex.Message); }
Protocol | Listen