Skip to content

Instantly share code, notes, and snippets.

View BrunoBonacci's full-sized avatar

Bruno Bonacci BrunoBonacci

View GitHub Profile
@BrunoBonacci
BrunoBonacci / snippet1.groovy
Created July 1, 2012 14:04
Vert.x Simple Telnet Server - session management
// this is the base directory where all user will be segregated (like: "chroot")
BASE_DIR = new File(System.properties.baseDir ?: "/tmp").canonicalPath;
// This map maintains the session state for every connection.
// for this telnet server the state will be limited to the current directory
_connections = [:];
// Connection id counter
_cids = 0;