TcpConnection.h

Go to the documentation of this file.
00001 #ifndef __TCPCONNECTION_H__
00002 #define __TCPCONNECTION_H__
00003 
00004 /*
00005 
00006 $Header$
00007 
00008 */
00009 
00010 #include "Connection.h"
00011 #include "Poller.h"
00012 
00013 using namespace std;
00014 
00015 typedef enum
00016 {
00017   TCP_CONNECTION_STATUS_CONNECTED    = 'C',
00018   TCP_CONNECTION_STATUS_DISCONNECTED = 'D',
00019   TCP_CONNECTION_STATUS_CONECTING    = 'c'
00020 } TcpConnectionStatus;
00021 
00022 class TcpConnection : public Connection
00023 {
00024 
00025   PYLON_OBJECT
00026 
00027 friend class Poller;
00028 friend class TcpServer;
00029 
00030 public:
00031 
00032   TcpConnection(const String &host, const String &service);
00033   TcpConnection(int socket, struct sockaddr_in *addr);
00034   virtual ~TcpConnection();
00035 
00036   int connect();
00037   int setNonBlock(const bool yes = true);
00038 
00039   TcpConnectionStatus status() const;
00040 
00041   // Signals.
00042   SIGNAL(connected);
00043 
00044 private:
00045 
00046   int setConnected();
00047 
00048   TcpConnectionStatus _status;
00049 };
00050 
00051 #endif

Generated on Thu Sep 6 20:11:25 2007 for Pylon Application Platform by  doxygen 1.5.1