class TcpListener
- TcpListener
- Reference
- Object
Overview
TCP_LISTENER is a production ready example of a crystal TCPSocket listener with a pool of 200 fibers ready to process incoming data
There are numerous caveats and tweaks you can do to optimize for your situation, where this example tries to meet a 'happy medium' between short lived TCP connections and large data bursts over a TCP socket.
This example DOES NOT try to be a long-lived TCP connection for websocket-like behavior. The assumption for this is many short-lived or high data connections.
Defined in:
tcp_engine/tcp_listener.crConstant Summary
-
TOTAL_FIBERS =
200
Constructors
Instance Method Summary
- #build_channel
- #get_socket_data(socket : TCPSocket, &)
- #listen
- #reader(socket : TCPSocket)
-
#set_trap
------------------------------------ Convenience method to turn on DEBUG with a USR1 signal ------------------------------------
- #spawn_listener(socket_channel : Channel)
- #stats_response(socket : TCPSocket)