Connection Properties |
The Connection type exposes the following members.
| Name | Description | |
|---|---|---|
| Available | 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. | |
| Binding | Get the Binding for this connection instance. | |
| BytesReceived | Gets the number of Bytes received for this Connection instance. | |
| BytesSent | Gets the number of Bytes sent for this Connection instance. | |
| CanRead |
Gets a value indicating whether the current connection supports reading.
(Overrides StreamCanRead) | |
| CanSeek |
Gets a value indicating whether the current connection supports seeking.
(Overrides StreamCanSeek) | |
| CanTimeout |
Gets a value that determines whether the current stream can time out.
(Inherited from Stream) | |
| CanWrite |
Gets a value indicating whether the current connection supports writing.
(Overrides StreamCanWrite) | |
| Connected | 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. | |
| DataSocketAvailable | Specified if the underlying DataSocket is Available. | |
| DataSocketConnected | Specified if the underlying DataSocket is connected. | |
| EnableNagle | Set the property value to true to enable the Nagle algorithm for send coalescing. | |
| Encoding | Get or set the encoding type for this connection instance. | |
| Length |
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) | |
| LocalEndPointAddress | 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. | |
| LocalEndPointPort | 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. | |
| MaxLineLength | 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). | |
| MaxLineLengthEnabled | 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. | |
| Position |
Get or set the position for the Connection instance.
(Overrides StreamPosition) | |
| ReadTimeout |
Gets or sets a value, in milliseconds, that determines how long the stream
will attempt to read before timing out.
(Inherited from Stream) | |
| RemoteEndPointAddress | 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. | |
| RemoteEndPointPort | 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. | |
| TimedOut | Gets the Timeout Status of this connection. | |
| Timeout | 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. | |
| TimeoutEnabled | 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. | |
| WriteTimeout |
Gets or sets a value, in milliseconds, that determines how long the stream
will attempt to write before timing out.
(Inherited from Stream) |