                     socket.on('end',   reconnect)
                     socket.on('close', reconnect)
                     socket.on('error', reconnect)
+
+                    @on 'mesg_ping', (mesg) =>
+                        @send_mesg
+                            mesg   : message.pong(id:mesg.id)
+                            call   : false
 
                     cb()
 

                    @dbg("ping", "pong: #{misc.mswalltime(t0)}ms")
                    cb()

######################################################################
# Network SERVER
######################################################################
class Server
    constructor : (opts) ->
        opts = defaults opts,
            token_file : DEFAULT_TOKEN_FILE
            port       : DEFAULT_PORT
            name       : 'Abstract'
            cb         : undefined

        @port = opts.port
        @name = opts.name
        async.series([
            (cb) =>
                @dbg("constructor","reading token file")

        else
            opts.cb?(undefined)


start_server = () ->
    winston.debug("start_server")
    new Server
        token_file : program.token
        port       : program.port


#############################################
# Process command line arguments -- copy something based
