
Start method
Starts listening and accepting connections.
Type
Integer.Syntax
- C#
- C++
- VB.NET
int devP2P.Start(IntPtr Handle, int protocol);
The Start(Handle,protocol) syntax has these parts:
The Start(Handle,protocol) syntax has these parts:
Handle | Reference to the devP2P instance. |
protocol | Protocols value, defines which transport protocol is allowed. |
Return value | 0 (ErrorNone) if success, otherwise negative value from Errors enumeration. |
int Start(Protocols prot = ProtoBoth);
The Start(prot) syntax has these parts:
The Start(prot) syntax has these parts:
prot | Protocols value, defines which transport protocol is allowed. |
Return value | 0 (ErrorNone) if success, otherwise negative value from Errors enumeration. |
Function P2P_Start(ByVal Handle As IntPtr, ByVal protocol As Integer) As Integer
The Start(Handle,protocol) syntax has these parts:
The Start(Handle,protocol) syntax has these parts:
Handle | Reference to the devP2P instance. |
protocol | Protocols value, defines which transport protocol is allowed. |
Return value | 0 (ErrorNone) if success, otherwise negative value from Errors enumeration. |
Remarks
Start method enabled devP2P to accept incoming connections. It is first method you will run after you set MyName and PeerName properties. At this point connection can already be established even you did not call Search or Link methods - because other peer may have done so and knows IP/Port of your peer.You can select here if you will allow usage of TCP and/or UDP ports for transport communication. Usually you will allow both. TCP is fast and reliable, and often is preferred. However, UDP penetrates firewalls in many cases, and will work where TCP doesn't. Our implementation of 'reliable UDP' matches speed of TCP so you will have usually no losses if UDP connection is established (except in rare cases where network connection is really bad). You can also select TCPPort and UDPPort where devP2P listens, or leave 0 so they are autoselected.
After Start is called, you can call Search to locate remote peer, or Link to it when you know his IP/Port where you should attempt connection. After you're done with using devP2P, you should call Stop method.
Platforms
WindowsMac OSX
Linux
BSD