Dart.PowerTCP.SslSockets Namespace > Tcp Class > BeginConnect Method : BeginConnect(String,Int32,String,Int32,Int32,Object) Method |
Connect to a server asynchronously, specifying the local interface and a range of local ports to use. The EndConnect event is raised when completed.
[Visual Basic]
<DescriptionAttribute("Connect to a server asynchronously. The EndConnect event is raised when completed.")>
Overloads Public Overridable Function BeginConnect( _
ByVal server As String, _
ByVal serverPort As Integer, _
ByVal client As String, _
ByVal clientPortMin As Integer, _
ByVal clientPortMax As Integer, _
ByVal state As Object _
) As IAsyncResult
[C#]
[DescriptionAttribute("Connect to a server asynchronously. The EndConnect event is raised when completed.")]
public virtual IAsyncResult BeginConnect(
string server,
int serverPort,
string client,
int clientPortMin,
int clientPortMax,
object state
);
[C++]
[DescriptionAttribute("Connect to a server asynchronously. The EndConnect event is raised when completed.")]
public: virtual IAsyncResult* BeginConnect(
string* server,
int serverPort,
string* client,
int clientPortMin,
int clientPortMax,
Object* state
)
[C++/CLI]
[DescriptionAttribute("Connect to a server asynchronously. The EndConnect event is raised when completed.")]
public:
virtual IAsyncResult^ BeginConnect(
String^ server,
int serverPort,
String^ client,
int clientPortMin,
int clientPortMax,
Object^ state
)
An IAsyncResult that represents the asynchronous operation, which could still be pending.
Exception | Description |
---|---|
InvalidOperationException | BeginXXX method used without providing an EndXXX event handler. |
Use this method if you wish to connect to a host transparently with minimal application impact, as execution occurs on another thread. This method begins to asynchronously connect to the server. Upon completion (on both success and failure) the EndConnect event is raised. An EventArgs object is passed into this event, containing information about the event. If the connection succeeds, the ConnectedChanged event is raised. Once the connection has been made, you can send and receive data from the remote device.
If you are using the Tcp component as a reference, you must "wire up" the event yourself. This involves creating a method as the event handler that implements the EventHandler delegate.
For more information on implementing and handling events using PowerTCP.NET, see the topic, Using Events In PowerTCP.
To connect synchronously, use the Connect method.
Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family
Tcp Class | Tcp Members | Overload List
Send comments on this topic.
Documentation version 1.1.2.0.
© 2008 Dart Communications. All rights reserved.