TsgcUDPServer implements the UDP Serverbased on Indy library.
UDP it's a connection less protocol where there is no assurance that message sent arrive to the destination but opposite to TCP protocol, it's much faster.
1. Drop a TsgcUDPServer component onto the form
2. Set the listening Port.
oClient := TsgcUDPServer.Create(nil);
oClient.Port := 80;
3. To start the server, set the property Active = true.
4. The following events are available:
OnStartup: when the UDP server start listening.
OnShutdown: when the UDP server stops listening.
OnUDPRead: called when a new message is received from the server. The message is in Bytes format.
OnUDPException: called when there is any exception in the UDP protocol.
OnDTLSVerifyPeer: allows to verify if the peer's certificate is correct.
Bindings: used to manage IP and Ports.
LogFile: if enabled, saves socket messages to a log file (useful for debugging).
Enabled: if enabled every time a message is received and sent by socket it will be saved on a file.
FileName: full path to the filename.
NotifyEvents: defines which mode to notify WebSocket events.
neAsynchronous: this is the default mode, notify threaded events on asynchronous mode, adds events to a queue that are synchronized with the main thread asynchronously.
neSynchronous: if this mode is selected, notify threaded events on synchronous mode, needs to synchronize with the main thread to notify these events.
neNoSync: there is no synchronization with the main thread, if you need to access to controls that are not thread-safe, you need to implement your own synchronization methods.
WatchDog: if enabled, restarts the server after unexpected disconnections.
Interval: seconds before reconnection attempts.
Attempts: maximum number of reconnection attempts; zero means unlimited.
DTLSOptions: if DTLS property is enabled, here you can customize some DTLS options (*DTLS is only supported on Enterprise Edition).
RootCertFile: path to root certificate file.
CertFile: path to certificate file.
KeyFile: path to certificate key file.
VerifyCertificate: if certificate must be verified, enable this property.
VerifyCertificate_Options:
FailfIfNoCertificate: if the client did not return a certificate, the TLS/SSL handshake is immediately terminated with a "handshake failure" alert.
VerifyClientOnce: only request a client certificate on the initial TLS/SSL handshake. Do not ask for a client certificate again in case of a renegotiation.
VerifyDepth: is an Integer property that represents the maximum number of links permitted when verification is
OpenSSL_Options: configuration of the openSSL libraries.
APIVersion: allows defining which OpenSSL API will be used. only openSSL API 1.1+ supports DTLS.
oslAPI_1_1: uses API 1.1 OpenSSL, requires our custom Indy library and allows using OpenSSL 1.1.1 libraries (with TLS 1.3 support).
oslAPI_3_0: uses API 3.0 OpenSSL, requires our custom Indy library and allows using OpenSSL 3.0.0 libraries (with TLS 1.3 support).
LibPath: here you can configure where are located the openSSL libraries
oslpNone: this is the default, the openSSL libraries should be in the same folder where is the binary or in a known path.
oslpDefaultFolder: sets automatically the openSSL path where the libraries should be located for all IDE personalities.
oslpCustomFolder: if this is the option selected, define the full path in the property LibPathCustom.
LibPathCustom: when LibPath = oslpCustomFolder define here the full path where are located the openSSL libraries.
UnixSymLinks: enable or disable the loading of SymLinks under Unix systems (by default is enabled, except under OSX64):
oslsSymLinksDefault: by default are enabled except under OSX64 (after MacOS Monterey fails trying to load the library without version.).
oslsSymLinksLoadFirst: Load SymLinks and do before trying to load the version libraries.
oslsSymLinksLoad: Load SymLinks after trying to load the version libraries.
oslsSymLinksDontLoad: don't load the SymLinks.