class

Telnet::Server

Inherits Reference < Object

Constructors

new(bind_address : String, bind_port : Int32, backlog : Int32 = Socket::SOMAXCONN)

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)
Source
new(port : Int32 = 23)

Create a new Telnet server instance. bind_address defaults to 127.0.0.1 port defaults to 23

server = Telnet::Server.new

or

server = Telnet::Server.new(9099)
Source

Instance methods

backlog
Source
backlog=(backlog : Int32)
Source
bind_address
Source
bind_port
Source
close

Alias of #shutdown

Source
listen

Start the io loop and then start server to listen for incoming connections.

server = Telnet::Server.new
server.listen
Source
listening?
Source
on_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
Source
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
Source
sessions
Source
shutdown

Shuts down the server socket.

Source

Macros

method_missing(call)
Source