From 7e99fac4552b402034e5fc3e833cbe8c274f95ce Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Fri, 21 Mar 2008 19:23:33 +0000 Subject: removed --- src/net/tcpconnection.h | 73 ------------------------------------------------- 1 file changed, 73 deletions(-) delete mode 100644 src/net/tcpconnection.h (limited to 'src/net/tcpconnection.h') diff --git a/src/net/tcpconnection.h b/src/net/tcpconnection.h deleted file mode 100644 index 79a61fe..0000000 --- a/src/net/tcpconnection.h +++ /dev/null @@ -1,73 +0,0 @@ -/* - net/tcpconnection.h - This file is part of the Osirion project and is distributed under - the terms of the GNU General Public License version 2 -*/ - -#ifndef __INCLUDED_NET_TCPCONNECTION_H__ -#define __INCLUDED_NET_TCPCONNECTION_H__ - -#include - -namespace net -{ - -/// A TCP client, connected to a file descriptor -/// Handles the connection from a client to a server -class TCPConnection -{ -public: - /// A new TCP client - TCPConnection(); - - /// Delete the TCP connection - /// If the file descriptor is still open, it will be closed. - virtual ~TCPConnection(); - - /// returns true if connected - bool connected(); - - /// the remote hostname the client is connected to - std::string host() const; - - /// the remote port the client is connected to - int port() const; - - /// the error state of the TCP client - bool error() const; - - /// returns true if the TCP connection has a valid file descriptor - bool valid() const; - - /// true if the TCP connection has an invalid file descriptor - bool invalid() const; - - /// return the file descriptor of the TCP connection - int fd() const; - - /// connect to a remote host - virtual void connect(std::string const &to_host, int to_port); - - /// disconnect from a remote host - virtual void disconnect(); - - /// set the TCP connection to the error state - void abort(); - - /// send outgoing data - virtual void send(std::string const &msg); - -protected: - /// receive incoming data - void receive(std::string &msg); - -private: - int tcpconnection_fd; - bool tcpconnection_error; - std::string tcpconnection_host; - int tcpconnection_port; -}; - -} - -#endif // __INCLUDED_NET_TCPCONNECTION_H__ -- cgit v1.2.3