QUIC Server Component — sgcQUIC | eSeGeCe

QUIC Server

TsgcQUICServer — a raw QUIC transport server (RFC 9000): bind a UDP port, load a certificate and key, terminate TLS 1.3, and handle each QUIC connection and stream in an event so you can build your own protocol on top of QUIC, in Delphi, C++ Builder and .NET.

TsgcQUICServer

The listener half of the raw QUIC pair. Point it at a port and a PEM certificate, activate it, and answer connections and stream data in events. Built on the native OpenSSL 3.5 QUIC engine.

Component class

TsgcQUICServer

Transport

QUIC (RFC 9000) over UDP, TLS 1.3

Languages

Delphi, C++ Builder, .NET

Bind a port, handle connections

Set the port and the certificate / key on QUICOptions, hook the QUIC events, then set Active. Reply on a connection's stream with WriteData.

uses
  sgcQUIC_Server;

var
  oServer: TsgcQUICServer;
begin
  oServer := TsgcQUICServer.Create(nil);
  oServer.Port := 443;
  oServer.QUICOptions.SSLOptions.CertFile := 'cert.pem';
  oServer.QUICOptions.SSLOptions.KeyFile  := 'key.pem';

  oServer.OnQUICConnect    := OnQUICConnectHandler;
  oServer.OnQUICData       := OnQUICDataHandler;      // bytes from a client
  oServer.OnQUICDisconnect := OnQUICDisconnectHandler;

  oServer.Active := True;
end;
// includes: sgcQUIC_Server.hpp

TsgcQUICServer *oServer = new TsgcQUICServer(NULL);
oServer->Port = 443;
oServer->QUICOptions->SSLOptions->CertFile = "cert.pem";
oServer->QUICOptions->SSLOptions->KeyFile  = "key.pem";

oServer->OnQUICConnect    = OnQUICConnectHandler;
oServer->OnQUICData       = OnQUICDataHandler;      // bytes from a client
oServer->OnQUICDisconnect = OnQUICDisconnectHandler;

oServer->Active = true;
using esegece.sgcWebSockets;

var oServer = new TsgcQUICServer();
oServer.Port = 443;
oServer.QUICOptions.SSLOptions.CertFile = "cert.pem";
oServer.QUICOptions.SSLOptions.KeyFile  = "key.pem";

oServer.OnQUICConnect    += OnQUICConnectHandler;
oServer.OnQUICData       += OnQUICDataHandler;      // bytes from a client
oServer.OnQUICDisconnect += OnQUICDisconnectHandler;

oServer.Active = true;

Key properties & methods

The members you reach for most often.

Listener

Port and Active bind and release the UDP listener; Start / Stop do it explicitly.

TLS

QUICOptions.SSLOptions.CertFile and KeyFile load the PEM certificate and private key for the TLS 1.3 handshake.

Streams

OpenStream(aConnection) opens a server-initiated stream; the builtin engine carries several streams per connection.

Send data

WriteData(aConnection, …) writes a string or TBytes payload back to a client on a stream.

Events

OnQUICConnect, OnQUICData, OnQUICStreamData, OnQUICDisconnect and OnQUICException handle the connection lifecycle and inbound bytes.

Lifecycle

OnStartup and OnShutdown fire as the listener starts and stops.

Keep exploring

Online HelpFull API reference and usage guide for sgcQUIC.
All sgcQUIC ComponentsBrowse the full feature matrix of all four components.
Download Free TrialStand up a QUIC listener and connect with the QUIC client.
PricingSingle, Team and Site licenses with full source code.
Best value: All-AccessEvery eSeGeCe product, Premium Support included, from €1,059/year.
See All-Access pricing

Ready to Get Started?

Download the free trial and stand up a QUIC server in Delphi, C++ Builder and .NET.