From 4b9289cfb260f4bcecaf23a810584ef6ef8e8501 Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Wed, 30 Mar 2011 22:33:41 +0000 Subject: Ok, string stuff is working much, much better, a load of new unit tests have been added, and I deleted a whole slew of stupid old tests that I don't need. --- src/tests/telnetsrv.cpp | 92 ------------------------------------------------- 1 file changed, 92 deletions(-) delete mode 100644 src/tests/telnetsrv.cpp (limited to 'src/tests/telnetsrv.cpp') diff --git a/src/tests/telnetsrv.cpp b/src/tests/telnetsrv.cpp deleted file mode 100644 index aac6b39..0000000 --- a/src/tests/telnetsrv.cpp +++ /dev/null @@ -1,92 +0,0 @@ -/* - * Copyright (C) 2007-2011 Xagasoft, All rights reserved. - * - * This file is part of the libbu++ library and is released under the - * terms of the license contained in the file LICENSE. - */ - -#include "bu/server.h" -#include "bu/protocoltelnet.h" -#include "bu/client.h" - -class MyTelnet : public Bu::ProtocolTelnet -{ -public: - MyTelnet() - { - } - - virtual ~MyTelnet() - { - } - - virtual void onNewConnection( Bu::Client *pClient ) - { - Bu::ProtocolTelnet::onNewConnection( pClient ); - - //oNAWS.remoteSet(); - oEcho.localSet(); - oSuppressGA.remoteSet( true ); - oSuppressGA.localSet( true ); - setCanonical(); - } - - virtual void onSubNAWS( uint16_t iWidth, uint16_t iHeight ) - { - printf("New dim = (%dx%d)\n", iWidth, iHeight ); - } - - virtual void gotLine( Bu::String &sLine ) - { - printf("Line: \"%s\"\n", sLine.getStr() ); - write("\n\r", 2 ); - } - -private: - -}; - -class TelServer : public Bu::Server -{ -public: - TelServer() - { - } - - virtual ~TelServer() - { - } - - virtual void onNewConnection( Bu::Client *pClient, int ) - { - printf("New connection.\n"); - - pClient->setProtocol( new MyTelnet() ); - } - - virtual void onClosedConnection( Bu::Client *pClient ) - { - printf("Lost connection.\n"); - - delete pClient->getProtocol(); - } - -private: - -}; - -int main() -{ - TelServer ts; - - ts.addPort( 4000 ); - ts.setTimeout( 0, 5000 ); - - printf("Initializing server on port: 4000\n"); - - for(;;) - { - ts.scan(); - } -} - -- cgit v1.2.3