// $Id$
//
-// Copyright (C) 2008
+// Copyright (C) 2008
// Fraunhofer Institute for Open Communication Systems (FOKUS)
// Competence Center NETwork research (NET), St. Augustin, GERMANY
// Stefan Bund <g0dil@berlios.de>
prefix_ senf::term::BaseTelnetProtocol::BaseTelnetProtocol(Handle handle)
: handle_ (handle), charState_ (NORMAL), command_ (CMD_NONE), option_ (0),
inputEvent_ ("senf::term::BaseTelnetProtocol::input",
- senf::membind(&BaseTelnetProtocol::readHandler, this), handle,
+ senf::membind(&BaseTelnetProtocol::readHandler, this), handle,
senf::scheduler::FdEvent::EV_READ),
outputEvent_ ("senf::term::BaseTelnetProtocol::output",
senf::membind(&BaseTelnetProtocol::writeHandler, this), handle,
requestTimeout_ (ClockService::milliseconds(DEFAULT_REQUEST_TIMEOUT_MS)),
timeout_ ("senf::term::BaseTelnetProtocol::timeout", 0)
{
- SENF_ASSERT( false );
+ SENF_ASSERT( false,
+ "Missing BaseTelnetProtocol constructor call in derived class "
+ "(BaseTelnetProtocol is a VIRTUAL base and MUST be constructed explicitly "
+ "in the most derived class." );
}
prefix_ void senf::term::BaseTelnetProtocol::write(std::string const & s)
handleChar(c);
break;
}
-}
+}
prefix_ void senf::term::BaseTelnetProtocol::handleOption(char c)
{
}
prefix_ void senf::term::BaseTelnetProtocol::writeHandler(int state)
-{
+{
if (state != senf::scheduler::FdEvent::EV_WRITE) {
outputEvent_.disable();
inputEvent_.disable();
v_eof();
return;
}
- sendQueue_.erase(sendQueue_.begin(),
+ sendQueue_.erase(sendQueue_.begin(),
handle_.write(boost::make_iterator_range(
sendQueue_.begin(), sendQueue_.end())));
if (sendQueue_.empty())
}
else if (enabled != info.enabled) {
// Request to change the current state
- if (!enabled ||
+ if (!enabled ||
(enabled && (info.wantState == OptInfo::WANTED || info.wantState == OptInfo::ACCEPTED))) {
// accept the request
info.optionState = OptInfo::ACKNOWLEDGED;