Telnet::Server
Constructors
Create a new Telnet server instance.
@bind_address is the IP address to bind the server to.
@bind_port is the port to bind the server to.
server = Telnet::Server.new("0.0.0.0", 9099)
Instance methods
backlog
Sourcebind_address
Sourcebind_port
Sourcelisten
Start the io loop and then start server to listen for incoming connections.
server = Telnet::Server.new
server.listen
listening?
Sourceon_connect
Set the callback to be called when a descriptor connects. The callback will be passed the descriptor descriptor. The callback yields the descriptor.
server.on_connect do |descriptor|
puts "descriptor connected from #{descriptor.remote_address}"
end
on_disconnect
Set the callback to be called when a descriptor disconnects. The callback will be passed the descriptor. The callback yields the descriptor.
server.on_disconnect do |descriptor|
puts "descriptor disconnected from #{descriptor.remote_address}"
end
sessions
SourceMacros
method_missing(call)
Source