• Main Page
  • Classes
  • Files
  • File List

repsock.h

00001 //-< REPSOCK.H >-----------------------------------------------------*--------*
00002 // GigaBASE                  Version 1.0         (c) 1999  GARRET    *     ?  *
00003 // (Post Relational Database Management System)                      *   /\|  *
00004 //                                                                   *  /  \  *
00005 //                          Created:      3-May-2003  K.A. Knizhnik  * / [] \ *
00006 //                          Last update:  3-Apr-2003  K.A. Knizhnik  * GARRET *
00007 //-------------------------------------------------------------------*--------*
00008 // Replication socket
00009 //-------------------------------------------------------------------*--------*
00010 
00011 #ifndef __REPSOCK_H__
00012 #define __REPSOCK_H__
00013 
00014 #include "sockio.h"
00015 
00016 BEGIN_GIGABASE_NAMESPACE
00017 
00018 //
00019 // Abstract socket interface
00020 //
00021 class GIGABASE_DLL_ENTRY replication_socket_t : public socket_t {
00022   public:
00023     virtual int       read(void* buf, size_t min_size, size_t max_size, time_t timeout);
00024     virtual bool      write(void const* buf, size_t size);
00025 
00026     virtual bool      is_ok();
00027     virtual void      get_error_text(char_t* buf, size_t buf_size);
00028 
00029     virtual bool      shutdown();
00030 
00031     virtual bool      close();
00032 
00033     virtual void      handleError(int socket, const char_t* operation, const char_t* error);
00034 
00035     static replication_socket_t*  connect(char const* addresses[],
00036                                           int n_addresses, 
00037                                           int max_attempts = DEFAULT_CONNECT_MAX_ATTEMPTS,
00038                                           time_t timeout = DEFAULT_RECONNECT_TIMEOUT);
00039 
00040     // 
00041     // Not implemented for replication socket
00042     //
00043     virtual socket_t* accept();
00044     virtual bool      cancel_accept();
00045     virtual char*     get_peer_name();
00046 
00047 
00048     ~replication_socket_t();
00049 
00050   protected:
00051     replication_socket_t(char const* addresses[], int n_adresses, int max_attempts, time_t timeout);
00052 
00053     socket_t**   sockets;
00054     int          n_sockets;
00055     bool         succeed;
00056 };
00057 
00058 END_GIGABASE_NAMESPACE
00059 
00060 #endif
00061 
00062 
00063 

Generated on Mon Aug 23 2010 00:04:01 for GigaBASE by  doxygen 1.7.1