The TcpTextClient type exposes the following members.

Constructors

  NameDescription
Public methodTcpTextClient
Initializes a new instance of the TcpTextClient object. Sets ReceiveTimeout and SendTimeout to 20 sec.

Methods

  NameDescription
Public methodAttach(Socket)
Attaches client to specified socket.
Public methodAttach(Socket, Boolean)
Attaches client to specified socket.
Public methodAttachSSL
Attaches client to specified socket.
Public methodClose()()()()
Issues quit command (CloseCommand()()()() method), closes the connection, disposes the object.
Public methodClose(Boolean)
Issues quit command (CloseCommand()()()() method) and closes the connection.
Protected methodCloseCommand
Derived classes should override this method to perform specific closing action.
Public methodConnect(IPEndPoint, Boolean)
Connects to server.
Public methodConnect(String, Int32)
Connects to server. Use ConnectSSL(String, Int32) when SSL connection is needed.
Public methodConnect(IPAddress, Int32, Boolean)
Connects to server.
Public methodConnect(String, Int32, Boolean)
Connects to server.
Public methodConnectSSL
Connects to server using SSL.
Public methodDispose
Releases all resources acquired by this object. Closes connection, without issuing any quit commands.
Public methodEquals
Determines whether the specified Object is equal to the current Object.
(Inherited from Object.)
Protected methodFinalize
Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
(Inherited from Object.)
Public methodGetHashCode
Serves as a hash function for a particular type.
(Inherited from Object.)
Protected methodGetServerGreeting
Override this function to get server's greeting.
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public methodSend
Sends the text command to server. Adds "\r\n" to the command.
Protected methodSwitchToSSL
Switches to SSL stream, authenticates as client.
Public methodToString
Returns a String that represents the current Object.
(Inherited from Object.)

Properties

  NameDescription
Public propertyConnected
Gets a value indicating whether the underlying Socket is connected to a remote host.
Public propertyReader
StreamReader used for reading from network stream or SSL stream.
Public propertyReceiveTimeout
Gets or sets the amount of time a TcpClient will wait to receive data once a read operation is initiated.
Public propertySendTimeout
Gets or sets the amount of time a TcpClient will wait for a send operation to complete successfully.
Public propertySocket
Gets the underlying Socket.
Public propertySSLConfiguration
Represents SSL configuration (client certificates, enabled SSL protocols).
Public propertySSLStream
Gets SslStream or null if SSL is not enabled.
Public propertyStream
Gets SslStream or NetworkStream for current connection.
Public propertyWriter
StringWriter used for writing to network stream or SSL stream.

Events

  NameDescription
Public eventServerCertificateValidate
Event which is called for custom server certificate validation.

See Also