Click or drag to resize

Connection Methods

The Connection type exposes the following members.

Methods
 NameDescription
Public methodAbort Aborts the Connection and closes the socket.
Public methodBeginRead Begins an asynchronous read operation.
(Overrides StreamBeginRead(Byte, Int32, Int32, AsyncCallback, Object))
Public methodBeginWrite Begins an asynchronous write operation.
(Overrides StreamBeginWrite(Byte, Int32, Int32, AsyncCallback, Object))
Public methodBufferReadLine Returns null if there is nothing in the buffer; Returns "" if it's an empty line, else the line in the buffer.
Public methodClose Closes the data connection to the remote and terminates any calls to Receive that might still be blocking.
(Overrides StreamClose)
Public methodClose(Boolean) Closes the data connection to the remote and terminates any calls to Receive that might still be blocking with option to Dispose.
Public methodConnect Opens a connection to the target remote system using an IP address and port number.
Protected methodDataSocketClose If data socket is connected, close it.
Protected methodDataSocketClose(Boolean) If the Data Socket connection is open, shut it down and optionally close and dispose of it.
Protected methodDataSocketInitializeServerConnection Initialize Server Connection Data Socket.
Protected methodDataSocketReceive Receive the specified number of bytes from the Data Socket Connection.
Protected methodDataSocketReceiveWhatsAvailable Receive as much data as is available from the Data Socket Connection.
Protected methodDataSocketSend(Byte) Send data to the Data Socket Connection for the entire length of the buffer.
Protected methodDataSocketSend(Byte, Int32, Int32) Send data to the Data Socket Connection until the specified size is reached.
Protected methodDataSocketSendAsMuchAsPossible Send as much data as possible to the Data Socket Connection.
Public methodDisconnect Closes the data connection to the remote and terminates any calls to Receive that might still be blocking.
Public methodDispose Disconnects and Disposes of the Connection elements.
Protected methodDispose(Boolean) Releases the unmanaged resources used by the Stream and optionally releases the managed resources.
(Inherited from Stream)
Public methodEndRead End Reading the stream for this Connection instance
(Overrides StreamEndRead(IAsyncResult))
Public methodEndWrite Ends an asynchronous write operation.
(Overrides StreamEndWrite(IAsyncResult))
Public methodEqualsDetermines whether the specified object is equal to the current object.
(Inherited from Object)
Protected methodFinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object)
Public methodFlush Flush for the Connection.
(Overrides StreamFlush)
Public methodGetHashCodeServes as the default hash function.
(Inherited from Object)
Public methodGetTypeGets the Type of the current instance.
(Inherited from Object)
Protected methodInitialize Initialize this Connection instance's timeout and maxLineLength.
Protected methodInitializeServerConnection Initializes the Server Connection for this instance.
Protected methodMemberwiseCloneCreates a shallow copy of the current Object.
(Inherited from Object)
Public methodRead The Read method is provided for compatibility with the Stream base class; it behaves identically to Receive. It will block until the entire buffer is filled or the connection has been closed.
(Overrides StreamRead(Byte, Int32, Int32))
Public methodReadByte Reads a byte from the stream and advances the position within the stream by one byte, or returns -1 if at the end of the stream.
(Inherited from Stream)
Public methodReadLine ReadLine will read data from the connection until a linebreak (either a CR LF or a single LF) is received. If MaxLineLengthEnabled is active, ReadLine will take security precautions to ensure the remote side is not sending strings that are too long.
Public methodReceive(Byte) Receive reads bytes from the connection. This function can be blocked to wait for additional incoming data.
Public methodReceive(Byte, Int32, Int32) Receive reads bytes from the connection with an offset and specified size. This function can be blocked to wait for additional incoming data.
Public methodReceiveAllRemaining Get data from connection until all bytes have been read (i.e., until Receive() returns 0). Uses a constant buffersize.
Public methodReceiveAllRemaining(Int32) Get data from connection until all bytes have been read (i.e., until Receive() returns 0). Uses a buffersize passed as a parameter.
Public methodReceiveWhatsAvailable ReceiveWhatsAvailable reads bytes from the connection to fill the passed byte[] buffer. Unlike Receive, this function will not block to wait for additional incoming data, but return immediately with the data that was available.
Public methodResetStatistics Reset the Statistics for this Connection instance.
Public methodSeek Seek for Connection instance.
(Overrides StreamSeek(Int64, SeekOrigin))
Public methodSend(Byte) This method sends a block of data to the remote side.
Public methodSend(Byte, Int32, Int32) This method sends a block of data to the remote side with specified Buffer, offset, and size.
Public methodSetLength Sets the length for Connection instance.
(Overrides StreamSetLength(Int64))
Public methodSkipBytes Skip the specified number of bytes to be read.
Protected methodStartTimeoutTimer Start the Timeout Timer for this Connection instance.
Protected methodStopTimeoutTimer Stop the Timeout Timer for this Connection instance.
Public methodToString ToString Method for this Connection instance.
(Overrides ObjectToString)
Protected methodTriggerOnBytesReceived Trigger for OnBytesReceived.
Protected methodTriggerOnBytesSent Trigger for OnBytesSent procedure.
Public methodWrite The Write method is provided for compatibility with the Stream base class; it behaves identically to Send.
(Overrides StreamWrite(Byte, Int32, Int32))
Public methodWriteByte Writes a byte to the current position in the stream and advances the position within the stream by one byte.
(Inherited from Stream)
Public methodWriteLine(String) The WriteLine method is similar to the Write method, but as in-parameter WriteLine it receives a string and finishes writing with carriage-return line feed character CRLF.
Public methodWriteLine(String, Object) The WriteLine method is similar to the Write method, but as in-parameter WriteLine it receives a string and finishes writing with carriage-return line feed character CRLF.
Public methodWriteLineLF(String) The WriteLineLF method is similar to the Write method, but as in-parameter WriteLineLF it receives a string and finishes writing with line feed character CRLF.
Public methodWriteLineLF(String, Object) The WriteLineLF method is similar to the Write method, but as in-parameter WriteLineLF it receives a string and finishes writing with line feed character CRLF.
Top
See Also