public virtual void Connect(string hostname, int port, byte[] handshake, TimeSpan? timeout) { var sock = new SocketWrapper(hostname, port, timeout); sock.Connect(handshake); Socket = sock; }
/// <summary> /// Asynchronously reconnects the underlying connection to the server. /// </summary> /// <param name="noreplyWait"><see cref="NoReplyWait"/></param> /// <param name="timeout">The timeout value before throwing exception</param> public virtual async Task ReconnectAsync(bool noreplyWait = false, TimeSpan? timeout = null) { Close(noreplyWait); Socket = new SocketWrapper(Hostname, Port, timeout ?? connectTimeout, sslContext, OnSocketErrorCallback); await Socket.ConnectAsync(handshake).ConfigureAwait(false); }