Click or drag to resize

Connection Properties

The Connection type exposes the following members.

Properties
 NameDescription
Public propertyAvailable Returns the number of bytes available in the local receive buffer. Override this method in descendant Connection classes if you need to perform additional handling or calculation on the size of available data.
Public propertyBinding Get the Binding for this connection instance.
Public propertyBytesReceived Gets the number of Bytes received for this Connection instance.
Public propertyBytesSent Gets the number of Bytes sent for this Connection instance.
Public propertyCanRead Gets a value indicating whether the current connection supports reading.
(Overrides StreamCanRead)
Public propertyCanSeek Gets a value indicating whether the current connection supports seeking.
(Overrides StreamCanSeek)
Public propertyCanTimeout Gets a value that determines whether the current stream can time out.
(Inherited from Stream)
Public propertyCanWrite Gets a value indicating whether the current connection supports writing.
(Overrides StreamCanWrite)
Public propertyConnected The boolean Connected property can be evaluated at any given time to find out if the Connection object is referring to an open Connection. When a connection is first obtained, it will be open and the property will be true. Once the connection has been closed, whether purposely or by remote, the property will turn to false.
Protected propertyDataSocketAvailable Specified if the underlying DataSocket is Available.
Public propertyDataSocketConnected Specified if the underlying DataSocket is connected.
Public propertyEnableNagle Set the property value to true to enable the Nagle algorithm for send coalescing.
Public propertyEncoding Get or set the encoding type for this connection instance.
Public propertyLength Length contains the entire known length of the incoming Connection stream. Returns the number of bytes that have been previously received (Position) plus the number of bytes that are waiting in the local receive buffer (Available).
(Overrides StreamLength)
Public propertyLocalEndPointAddress LocalEndPointAddress specifies the local address that this connection is assigned to. For clients, this will usually be a random IP address; For servers, this will be the IP address that the connection came in on.
Public propertyLocalEndPointPort LocalEndPointPort specifies the local port that this connection is assigned to. For clients, this will usually be a random port; For servers, this will be the port that the connection came in on.
Public propertyMaxLineLength The MaxLineLength property specifies the maximum number of bytes that a ReadLine operation will receive. The maximum line checking can be activated by the MaxLineLengthEnabled property, the default value is 1024 bytes (1kB).
Public propertyMaxLineLengthEnabled The MaxLineLengthEnabled property toggles whether the ReadLine function will enforce a maximum line length. When turned on (true), ReadLine will fail and the connection will be terminated if the remote side sends a line longer than the defined MaxLineLength bytes.
Public propertyPosition Get or set the position for the Connection instance.
(Overrides StreamPosition)
Public propertyReadTimeout Gets or sets a value, in milliseconds, that determines how long the stream will attempt to read before timing out.
(Inherited from Stream)
Public propertyRemoteEndPointAddress RemoteEndPointAddress specifies the remote address that this connection is assigned to. For clients, this will be the IP address that they connected to; For servers, this will usually be a random port of the connected client.
Public propertyRemoteEndPointPort RemoteEndPointPort specifies the remote port that this connection is assigned to. For clients, this will be the port that they connected to; For servers, this will usually be a random port on the connected client.
Public propertyTimedOut Gets the Timeout Status of this connection.
Public propertyTimeout The Timeout property specifies the maximum amount of time (in seconds) that a Connection will wait for incoming data within a single Receive operation. The timeout handling can be activated by the TimeoutEnabled property, the default value is 5 minutes.
Public propertyTimeoutEnabled The TimeoutEnabled property toggles whether the Connection will do automatic timeout checking. When turned on (true), the Connection will keep track of the time that passes during any single Receive operation - if a receive operation takes longer than the given timeout, the connection will be terminated.
Public propertyWriteTimeout Gets or sets a value, in milliseconds, that determines how long the stream will attempt to write before timing out.
(Inherited from Stream)
Top
See Also