IBR-DTNSuite  0.8
ibrcommon/ibrcommon/net/tcpclient.h
Go to the documentation of this file.
00001 /*
00002  * tcpclient.h
00003  *
00004  *  Created on: 29.07.2009
00005  *      Author: morgenro
00006  */
00007 
00008 #ifndef IBRCOMMON_TCPCLIENT_H_
00009 #define IBRCOMMON_TCPCLIENT_H_
00010 
00011 #include "ibrcommon/net/tcpstream.h"
00012 #include "ibrcommon/Exceptions.h"
00013 #include "ibrcommon/data/File.h"
00014 
00015 namespace ibrcommon
00016 {
00017         class tcpclient : public tcpstream
00018         {
00019         public:
00020                 class SocketException : public Exception
00021                 {
00022                 public:
00023                         SocketException(string error) : Exception(error)
00024                         {};
00025                 };
00026 
00031                 tcpclient();
00032 
00038                 tcpclient(const ibrcommon::File &socket);
00039                 void open(const ibrcommon::File &socket);
00040 
00047                 tcpclient(const std::string &address, const int port, size_t timeout = 0);
00048                 void open(const std::string &address, const int port, size_t timeout = 0);
00049 
00054                 virtual ~tcpclient();
00055         };
00056 }
00057 
00058 #endif /* TCPCLIENT_H_ */