Delphi Cross-platform Socket Communication Library
Author: WiNDDRiVER([email protected])
English
Donate
If you find this project useful to you, please consider donating and supporting the author to continue to update


Update records
2023.09.18
- Supports FPC 3.3.1
- Support OpenSSL 3.x
- Added the HTTP client ICrossHttpClient (supports gzip/deflate compressed sending)
- Added WebSocket client ICrossWebSocket
- The HTTP server supports collecting gzip/deflate compressed data
- Partial code reconstruction
- Some minor issues fixed
2020.07.07
- ICrossHttpServer and ICrossWebSocketServer support both http and https
Thanks to xlnron for your help
2019.02.17
- Fixed memory leaks that may cause by TIoEventThread
Thanks to viniciusfbb for discovering and fixing this issue
- Fixed memory leaks caused by [weak]
When used with a third-party memory management library, a memory leak occurs. Robertodellapasqua discovered this problem, and finally pony5551 found the cause of the problem. Thank you very much! This should be a flaw in Delphi's [weak] internal implementation, and the problem was solved after replacing [weak] with [unsafe].
2019.01.15
- Added mbedtls support
- Enable method of mbedtls: Turn on the two compilation switches __CROSS_SSL__ and __MBED_TLS__ in the project compilation options, and add the directory under MbedObj to the Library path of the corresponding platform
- At present, mbedtls support is not stable enough, please do not use it in production environments
2017.08.22
- Code refactoring, a lot of modifications have been made, see the source code for details
- Several new interfaces have been added, see demos for details for usage
- ICrossSocket
- ICrossSslSocket
- ICrossServer
- ICrossSslServer
characteristic
Use different IO models for different platforms:
Windows
FreeBSD (MacOSX, iOS...)
Linux (Linux, Android...)
Supports extremely high concurrency
Can run more than 100,000 concurrent numbers, you need to modify the registry to adjust the default maximum number of ports
After preliminary tests, the test environment is OSX 10.9.5 in the virtual machine. Even if the system handle limit is modified, it can only open more than 32,000 concurrent connections at most. Perhaps the OSX Server version can support higher concurrency.
Supports IPv4 and IPv6 at the same time
Zero memory copy
Passed the test
- Windows
- OSX
- iOS
- Android
- Linux
Recommended development environment
- To play the full cross-platform functionality, please use Delphi 10.2 Tokyo and above
- The minimum requirement is to support the Delphi version of generic and anonymous functions. I am not very clear about which version to support generic and anonymous functions.
- It is best to use FPC version 3.3.1 and above
Some test screenshots
HTTPS Benchmark 
HTTP Server (Linux-aarch64) 
HTTP Server (Linux-loongarch64) 
HTTP Client (Linux-aarch64) 
HTTP Client (Linux-loongarch64) 
WebSocket Server (Linux-aarch64) 
WebSocket Server (Linux-loongarch64) 
WebSocket Client (Linux-aarch64) 
WebSocket Client (Linux-loongarch64) 
HTTP (server is ubuntu 16.04 desktop)
HTTPS (server is ubuntu 16.04 desktop)