void FileEndpoint::initialize(){
    NMEAEndpoint::initialize();
    registerIntCmd("min_available","Minimimum remaining disk space", "Defines the minimum remaining disk space that should be left. When there is not enough space on the disk hosting this file, nothing is written. 0 = nocheck", &min_available_mbs, 0, 0, std::numeric_limits<int>::max(), true);
    boost::function<void (Command_ptr)> func = boost::bind(&FileEndpoint::space_left_cmd, this, _1);
    registerVoidCmd("space_left","Print Space left", "Prints the space left on the disk",  func);
    func = boost::bind(&FileEndpoint::seek_cmd, this, _1);
    registerVoidCmd("seek","Seek position in log", "Put playback position at time.",  func);
    registerBoolCmd("record_answer","Record answers", "When on, answers are recorded to the file aswell.",  &record_answers, false, true);
    registerStringCmd("timestamp_format", "Format of the timestamp for messages", "Defines how the timestamp in front of each message is formated. Default is: \"%Y-%m-%d %H:%M:%s\" ", &timestamp_format, "%Y-%m-%d %H:%M:%s ", true);
    registerUIntCmd("speedup","Speedup factor for playback", "Defines the factor for speedup of playback", &speedup, 1, 1, 1000, true);
    
    registerEndpoint();
}
template<class T> void AsyncEndpoint<T>::initialize(){
    NMEAEndpoint::initialize();
    
    registerBoolCmd("persist" ,"Session persistance", "When on, messages are stored after a disconnect and after the reconnect replayed. See also [queue_size]", &persist, false, true);
    registerUIntCmd("queue_size","Message Queue Size", "Defines the maximum size of the message queue for this endpoint. See also [persist]", &message_queue_size, 10, 0, std::numeric_limits<unsigned int>::max(), true);
    boost::function<void (Command_ptr)> func = boost::bind(&AsyncEndpoint<T>::exit_cmd, this, _1);
    registerVoidCmd("exit","End Session", "Ends the session and disconnects the remote host. Command does not take any arguments.",  func);
    unregisterCmd("print_stats");
    boost::function<void (Command_ptr)> func2 = boost::bind(&AsyncEndpoint<T>::print_stats_cmd, this, _1);
    registerVoidCmd("print_stats","Print Session statistics", "Prints statistics about the session.",  func2);
    isActive=false;
    wasFull = false;
}