Starts connection to the specified host.
Declaration Syntax
C# | Visual Basic | Visual C++ | F# |
[ObsoleteAttribute("Use method ConnectAsync instead.")] public IAsyncResult BeginConnect( string host, int port, AsyncCallback callback, Object state )
<ObsoleteAttribute("Use method ConnectAsync instead.")> Public Function BeginConnect ( host As String, port As Integer, callback As AsyncCallback, state As Object ) As IAsyncResult
public: [ObsoleteAttribute(L"Use method ConnectAsync instead.")] IAsyncResult^ BeginConnect( String^ host, int port, AsyncCallback^ callback, Object^ state )
[<ObsoleteAttribute("Use method ConnectAsync instead.")>] member BeginConnect : host : string * port : int * callback : AsyncCallback * state : Object -> IAsyncResult
Parameters
- host (String)
- Host name or IP address.
- port (Int32)
- Port to connect.
- callback (AsyncCallback)
- Callback to call when the connect operation is complete.
- state (Object)
- User data.
Return Value
IAsyncResult
An IAsyncResult that references the asynchronous connection.
An IAsyncResult that references the asynchronous connection.
Exceptions
Exception | Condition |
---|---|
ObjectDisposedException | Is raised when this object is disposed and this method is accessed. |
InvalidOperationException | Is raised when TCP client is already connected. |
ArgumentException | Is raised when any of the arguments has invalid value. |
Assembly: LumiSoft.Net (Module: LumiSoft.Net.dll) Version: 4.5.5510.19119