Back to product page

TCPPort property


Specifies local TCP port used for listening.

Type

Integer.

Syntax

  • C#
  • C++
  • VB.NET
void devP2P.SetTCPPort(IntPtr Handle, int Value);
The TCPPort(Handle,value) syntax has these parts:
HandleReference to the devP2P instance.
valueInteger value representing local TCP port.

int devP2P.GetTCPPort(IntPtr Handle);
The TCPPort(Handle) syntax has these parts:
HandleReference to the devP2P instance.
Return valueInteger value representing local TCP port.

int TCPPort = value;
The TCPPort(value) syntax has these parts:
valueInteger value representing local TCP port.

Sub P2P_SetTCPPort(ByVal Handle As IntPtr, ByVal Value As Integer)
The TCPPort(Handle,value) syntax has these parts:
HandleReference to the devP2P instance.
valueInteger value representing local TCP port.

Function P2P_GetTCPPort(ByVal Handle As IntPtr) As Integer
The TCPPort(Handle) syntax has these parts:
HandleReference to the devP2P instance.
Return valueInteger value representing local TCP port.

Remarks

TCPPort property defines on local TCP port where devP2P listens and accepts connections from remote peer. You can predefine it before calling Start method, in which case devP2P will force using your port. You can also set it to 0, in which case devP2P will allocate first free port (as provided by the system) and fill this property with allocated port.

If you're not interested which port will be allocated in Start method, it is wise to set this property to zero each time before calling the Start method, since on subsequent Start method calls devP2P could reuse previously filled port value.

Platforms

Windows
Mac OSX
Linux
BSD