| Visual Basic (Declaration) | |
|---|---|
<DefaultValueAttribute()> <CategoryAttribute("Socket Options")> <DescriptionAttribute("Gets or Sets a value that typically allows any local port to be specified, even if it is already in use.")> Public Property ReuseAddress As Boolean | |
| Visual Basic (Usage) | Copy Code |
|---|---|
Dim instance As Tcp Dim value As Boolean instance.ReuseAddress = value value = instance.ReuseAddress | |
| C# | |
|---|---|
[DefaultValueAttribute()] [CategoryAttribute("Socket Options")] [DescriptionAttribute("Gets or Sets a value that typically allows any local port to be specified, even if it is already in use.")] public bool ReuseAddress {get; set;} | |
| Managed Extensions for C++ | |
|---|---|
[DefaultValueAttribute()] [CategoryAttribute("Socket Options")] [DescriptionAttribute("Gets or Sets a value that typically allows any local port to be specified, even if it is already in use.")] public: __property bool get_ReuseAddress(); public: __property void set_ReuseAddress( bool value ); | |
| C++/CLI | |
|---|---|
[DefaultValueAttribute()] [CategoryAttribute("Socket Options")] [DescriptionAttribute("Gets or Sets a value that typically allows any local port to be specified, even if it is already in use.")] public: property bool ReuseAddress { bool get(); void set ( bool value); } | |
Property Value
true if a specific local port number is desired for multiple active connections; otherwise false. The default is false, to indicate it should not be allowed.The following example demonstrates some of the lesser used Tcp component members.
| Visual Basic | Copy Code |
|---|---|
' Disable UI events. Tcp1.DoEvents = False ' Enable KeepAlive socket option Tcp1.KeepAlive = True ' Disable use of Nagle's Algoritm Tcp1.NoDelay = True ' Read urgent data as normal in-line data. Tcp1.OutOfBandInline = True ' Allow addresses to be reused Tcp1.ReuseAddress = True ' Connect Tcp1.Connect("atropos", 7) ' Send data Tcp1.Send("test") ' Receive response Dim seg As Segment = Tcp1.Receive() | |
| C# | Copy Code |
|---|---|
// Disable UI events. tcp1.DoEvents = false; // Enable KeepAlive socket option tcp1.KeepAlive = true; // Disable use of Nagle's Algoritm tcp1.NoDelay = true; // Read urgent data as normal in-line data. tcp1.OutOfBandInline = true; // Allow addresses to be reused tcp1.ReuseAddress = true // Connect tcp1.Connect("atropos", 7); // Send data tcp1.Send("test"); // Receive response Segment seg = tcp1.Receive(); | |
The option is used (set to true) when a specific local port number is desired for multiple active connections.
Target Platforms: Microsoft .NET Framework 2.0
Copy Code