class EncryptedTcp::TcpListener
- EncryptedTcp::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 optmize 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.
Defined in:
tcp_engine/tcp_listener.crConstant Summary
-
TOTAL_FIBERS =
(ENV["TOTAL_FIBERS"]? || "5000").to_i
Constructors
Instance Method Summary
- #build_channel
- #get_socket_data(socket : TCPSocket, &)
- #listen
- #reader(socket : TCPSocket)
-
#set_trap
------------------------------------ Convernience method to turn on DEBUG with a USR1 signal ------------------------------------
- #spawn_listener(socket_channel : Channel)
- #stats_response(socket : TCPSocket)
Constructor Detail
def self.new(host : String, port : Int32, action : ActionHandler, config : Hash(String, String))
#