RUDPConnection Type

A currently connected client.

Remarks

This type describes the connection of a client which is currently connected to the component. You may use the different fields of this type to manage the connection.

Fields

AcceptData
Boolean

Setting this field to False, temporarily disables data reception (and the DataIn event) on the connection. Setting this to True, re-enables data reception.

BytesSent
Integer

This field shows how many bytes were sent after the last assignment to DataToSend. Please check DataToSend for more information.

Connected
Boolean

This field is used to disconnect individual connections and/or show their status.

The Connected field may be set to false to close the connection.

Connected also shows the status of a particular connection (connected/disconnected).

How and when the connection is closed is controlled by the Linger property. Please refer to its description for more information.

ConnectionId
String

This field contains an identifier generated by the component to identify each connection. This identifier is unique to this connection.

DataToSend
String

This field contains a string of data to be sent to the remote host.

Assigning a string to the DataToSend makes the component send the string to the remote host. The Send method provides similar functionality.

When DefaultTimeout is set to a positive value the componentwill behave synchronously. The component will not return control until all data has been delivered or an error is encountered.

When DefaultTimeout is set to 0 the component will behave asynchronously. The component will return control immediately. If data is being sent quickly and more than MaxOutgoingOutstandingCount packets are unacknowledged DataToSend will fail with a "Wouldblock" exception. When this exception occurs the BytesSent field holds the number of bytes that were sent (if any). Monitor the ReadyToSend event to determine when sending can resume. Resend the data which previously caused the exception after ReadyToSend fires.

DataToSendB
Byte[]

This field contains a string of data to be sent to the remote host.

Assigning a string to the DataToSend makes the component send the string to the remote host. The Send method provides similar functionality.

When DefaultTimeout is set to a positive value the componentwill behave synchronously. The component will not return control until all data has been delivered or an error is encountered.

When DefaultTimeout is set to 0 the component will behave asynchronously. The component will return control immediately. If data is being sent quickly and more than MaxOutgoingOutstandingCount packets are unacknowledged DataToSend will fail with a "Wouldblock" exception. When this exception occurs the BytesSent field holds the number of bytes that were sent (if any). Monitor the ReadyToSend event to determine when sending can resume. Resend the data which previously caused the exception after ReadyToSend fires.

LocalAddress
String

This field shows the IP address of the interface through which the connection is passing.

LocalAddress is important for multi-homed hosts where it can be used to find which particular network interface an individual connection is going through.

RemoteHost
String

This field shows the IP address of the remote host through which the connection is coming.

The connection must be valid or an error will be fired.

If the component is configured to use a SOCKS firewall, the value assigned to this property may be preceded with an "*". If this is the case, the host name is passed to the firewall unresolved and the firewall performs the DNS resolution.

RemotePort
Integer

This field shows the UDP port on the remote host through which the connection is coming.

The connection must be valid or an error will be fired.

Timeout
Integer

This field contains a timeout for the component.

If the Timeout property is set to 0, all operations return immediately, potentially failing with a 'WOULDBLOCK' error if data can't be sent or received immediately.

If Timeout is set to a positive value, the component will automatically retry each operation that would otherwise result in a 'WOULDBLOCK' error for a maximum of Timeout seconds.

The component will use DoEvents to enter an efficient wait loop during any potential waiting period, making sure that all system events are processed immediately as they arrive. This ensures that the host application does not "freeze" and remains responsive.

If Timeout expires, and the operation is not yet complete, the component throws an exception.

Please note that by default, all timeouts are inactivity timeouts, i.e. the timeout period is extended by Timeout seconds when any amount of data is successfully sent or received.

The default value for the Timeout property is 0 (asynchronous operation).

UploadStream
System.IO.Stream

Setting this field uploads the data in the specified stream to the current connection. The component will automatically close this stream if CloseStreamAfterTransfer is True (default).

Constructors

public RUDPConnection();
Public RUDPConnection()

Copyright (c) 2022 /n software inc. - All rights reserved.
IPWorks P2P 2020 .NET Edition - Version 20.0 [Build 8235]