Download the PHP package kislayphp/socket without Composer
On this page you can find all versions of the php package kislayphp/socket. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download kislayphp/socket
More information about kislayphp/socket
Files in kislayphp/socket
Package socket
Short Description High-performance C++ PHP extension providing realtime socket transport for long-running PHP services
License Apache-2.0
Homepage https://github.com/KislayPHP/socket
Informations about the package socket
Kislay Socket
Kislay Socket is the realtime socket transport package for KislayPHP. It provides long-running socket communication with Engine.IO polling, WebSocket upgrade support, rooms, namespaces, and event callbacks.
During 0.0.x, the package keeps compatibility aliases for existing EventBus namespaces:
Kislay\\Socket\\*is the primary APIKislay\\EventBus\\*andKislayPHP\\EventBus\\*remain available as compatibility aliases
Versioning
This package stays on the 0.0.x line until the transport surface, docs, and ecosystem integration are production-ready.
Installation
PIE
Add to php.ini:
Build from source
Minimal Server
Public API
Kislay\\Socket\\Server
on(string $event, callable $handler): boolemit(string $event, mixed $data): boolemitTo(string $room, string $event, mixed $data): boollisten(string $host, int $port, string $path): boolclientCount(): introomCount(string $room): intonAuth(callable $handler): boolonWithAck(string $event, callable $handler): boolgetClients(): arraysetMaxPayload(int $bytes): boolnamespace(string $ns): Kislay\\Socket\\Namespace
Kislay\\Socket\\Socket
id(): stringjoin(string $room): boolleave(string $room): boolemit(string $event, mixed $data): boolreply(string $event, mixed $data): boolemitTo(string $room, string $event, mixed $data): bool
Behavior notes:
Server::emit()broadcasts to all connected clients.Socket::emit()sends only to the current client.Socket::reply()is an alias for per-client emit.listen()blocks until the server stops.
Configuration
Primary environment variables:
KISLAYPHP_SOCKET_PING_INTERVAL_MSKISLAYPHP_SOCKET_PING_TIMEOUT_MSKISLAYPHP_SOCKET_MAX_PAYLOADKISLAYPHP_SOCKET_CORSKISLAYPHP_SOCKET_ALLOW_UPGRADEKISLAYPHP_SOCKET_TRANSPORTSKISLAYPHP_SOCKET_AUTH_ENABLEDKISLAYPHP_SOCKET_AUTH_TOKENKISLAYPHP_SOCKET_AUTH_QUERY_KEYSKISLAYPHP_SOCKET_AUTH_HEADER_KEYS
Legacy KISLAYPHP_EVENTBUS_* and KISLAYPHP_AUTH_* environment variables are still accepted during 0.0.x for migration compatibility.
Current Limits
- in-process single server runtime
- no durable message history
- no multi-node transport bridge in this package yet
- at this stage, treat it as the socket transport layer, not as a durable event platform
Positioning
Use kislayphp/socket for:
- realtime browser or service socket connections
- rooms and namespaces
- request/response style live events
- transport-level event delivery
Use kislayphp/queue for:
- background jobs
- retries and DLQ
- worker/server queue processing
Use future higher-level EventBus semantics only for distributed event distribution, not for the socket transport package itself.