# ldcsaa/hp-socket

**Attribution required: if you use, quote, or summarise this content, you must credit and link back to [awesome-repositories.com](https://awesome-repositories.com/repository/ldcsaa-hp-socket).**

6,132 stars · 1,795 forks · C · NOASSERTION

## Links

- GitHub: https://github.com/ldcsaa/HP-Socket
- Homepage: https://www.oschina.net/p/hp-socket
- awesome-repositories: https://awesome-repositories.com/repository/ldcsaa-hp-socket.md

## Topics

`android` `c` `cpp` `cross-platform` `epoll` `hpsocket` `http` `https` `iocp` `linux` `ndk` `netcore` `network` `networking` `socket` `ssl` `tcp` `udp` `websocket` `windows`

## Description

HP-Socket is a networking library for building scalable TCP, UDP, and HTTP servers and clients with event-driven I/O and SSL encryption. It provides a high-performance TCP server framework, an HTTP request handler that parses incoming requests and generates responses, and a UDP communication library for low-latency data transfer, all with optional SSL encryption for secure communication.

The library is built on a completion-port-based I/O architecture that uses Windows I/O Completion Ports for scalable asynchronous socket operations. It features a connection-pooled agent architecture for managing multiple outbound connections, an event-driven callback model for handling connection, data, and shutdown events, and a multi-threaded worker pool for parallel processing. Object-pool memory management reduces allocation overhead, while a protocol-agnostic socket abstraction provides a unified interface across TCP, UDP, and HTTP. An SSL/TLS integration layer wraps socket streams with pluggable encryption for authenticated data transfer.

The library covers concurrent outbound connection management, TCP connection management for both servers and clients, and UDP data transfer for real-time communication needs. It also includes SSL-encrypted data transfer for secure communication across all supported protocols.

## Tags

### Networking & Communication

- [TCP Server Frameworks](https://awesome-repositories.com/f/networking-communication/tcp-server-frameworks.md) — Runs a high-concurrency TCP server that handles many simultaneous connections using event-driven I/O for scalable network applications. ([source](https://cdn.jsdelivr.net/gh/ldcsaa/hp-socket@dev/README.md))
- [Event-Driven Networking](https://awesome-repositories.com/f/networking-communication/event-driven-networking.md) — Responds to connection, data, send, close, and shutdown events by attaching callback functions to listener objects.
- [Protocol-Agnostic Interfaces](https://awesome-repositories.com/f/networking-communication/networking-libraries/protocol-agnostic-interfaces.md) — Provides a unified interface for TCP, UDP, and HTTP communication over the same event-driven core.
- [TCP Client Connections](https://awesome-repositories.com/f/networking-communication/tcp-connection-lifecycles/tcp-client-connections.md) — Provides a high-performance TCP client connection framework using event-driven I/O for scalable applications. ([source](https://github.com/ldcsaa/hp-socket/tree/dev/docs/))
- [TCP Event Callbacks](https://awesome-repositories.com/f/networking-communication/tcp-connection-lifecycles/tcp-client-connections/tcp-event-callbacks.md) — Implements an event-driven callback model for handling TCP connection, data, and shutdown events. ([source](https://cdn.jsdelivr.net/gh/ldcsaa/hp-socket@dev/README.md))
- [Outbound Connection Managers](https://awesome-repositories.com/f/networking-communication/outbound-connection-managers.md) — Manages many concurrent outbound socket connections from a single agent using the same architecture as the server.
- [UDP Communication](https://awesome-repositories.com/f/networking-communication/udp-communication.md) — Provides a UDP communication library for low-latency data transfer suitable for real-time applications. ([source](https://github.com/ldcsaa/hp-socket/tree/dev/docs/))
- [Low-Latency UDP Transports](https://awesome-repositories.com/f/networking-communication/udp-communication/low-latency-udp-transports.md) — Sends and receives UDP data with low latency for real-time communication needs such as gaming or streaming.

### DevOps & Infrastructure

- [Connection-Pooled Agents](https://awesome-repositories.com/f/devops-infrastructure/outbound-connectivity-agents/connection-pooled-agents.md) — Implements a connection-pooled agent architecture for managing multiple outbound connections with the same I/O model as the server.

### Operating Systems & Systems Programming

- [Completion Port I/O Engines](https://awesome-repositories.com/f/operating-systems-systems-programming/high-performance-i-o-engines/completion-port-i-o-engines.md) — Ships a completion-port-based I/O architecture using Windows IOCP for scalable asynchronous socket operations.
- [Memory Object Pools](https://awesome-repositories.com/f/operating-systems-systems-programming/kernel-core-internals/process-and-memory-management/memory-management/allocation-strategies/dynamic-memory-allocation/custom-memory-allocators/memory-object-pools.md) — Reuses socket and buffer objects from pre-allocated pools to reduce allocation overhead and memory fragmentation.

### Security & Cryptography

- [Pluggable SSL/TLS Integration Layers](https://awesome-repositories.com/f/security-cryptography/security/cryptography-and-secrets/cryptographic-primitives-management/tls-ssl-configurations/pluggable-ssl-tls-integration-layers.md) — Wraps socket streams with SSL encryption using a pluggable security provider for authenticated data transfer.
- [SSL-Enabled Socket Wrappers](https://awesome-repositories.com/f/security-cryptography/security/cryptography-and-secrets/cryptographic-primitives-management/tls-ssl-configurations/ssl-enabled-socket-wrappers.md) — Encrypts TCP, UDP, and HTTP data transfers using SSL for secure communication across all supported protocols.
- [SSL/TLS Connection Security](https://awesome-repositories.com/f/security-cryptography/ssl-tls-connection-security.md) — Encrypts data sent over TCP, UDP, or HTTP connections using SSL for authenticated and secure communication. ([source](https://cdn.jsdelivr.net/gh/ldcsaa/hp-socket@dev/README.md))

### Software Engineering & Architecture

- [Event-Driven Callbacks](https://awesome-repositories.com/f/software-engineering-architecture/event-driven-callbacks.md) — Attaches user-defined callback functions to listener objects for handling connection, data, and shutdown events.

### System Administration & Monitoring

- [I/O Completion Worker Pools](https://awesome-repositories.com/f/system-administration-monitoring/alert-thresholds/thread-pool/configurable-worker-thread-pools/i-o-completion-worker-pools.md) — Distributes I/O completion events across a fixed pool of worker threads for parallel processing.

### Web Development

- [Multi-Protocol Networking Libraries](https://awesome-repositories.com/f/web-development/high-performance-http-servers/multi-protocol-networking-libraries.md) — Provides a networking library for building scalable TCP, UDP, and HTTP servers and clients with event-driven I/O and SSL encryption.
- [HTTP Request Handling](https://awesome-repositories.com/f/web-development/backend-development/request-response-handling/http-request-handling.md) — Provides an HTTP component that parses incoming requests and generates responses over TCP connections. ([source](https://cdn.jsdelivr.net/gh/ldcsaa/hp-socket@dev/README.md))
- [HTTP Request Handlers](https://awesome-repositories.com/f/web-development/http-request-handlers.md) — Parses incoming HTTP requests and generates responses over TCP connections with optional SSL encryption.
