Main Page   Namespace List   Class Hierarchy   Compound List   File List   Compound Members   File Members  

unix_pipe_connection.h

Go to the documentation of this file.
00001 /*
00002         ------------------------------------------------------------------------
00003         ClanLib, the platform independent game SDK.
00004 
00005         This library is distributed under the GNU LIBRARY GENERAL PUBLIC LICENSE
00006         version 2. See COPYING for details.
00007 
00008         For a total list of contributers see CREDITS.
00009 
00010         ------------------------------------------------------------------------
00011 
00012         File purpose:
00013                 Network delivery implementation - Unix sockets version.
00014 */
00015 
00016 #ifdef USE_NETWORK
00017 
00018 #ifndef header_network_delivery_pipe
00019 #define header_network_delivery_pipe
00020 
00021 #include <sys/time.h>
00022 #include <sys/types.h>
00023 #include <sys/socket.h>
00024 #include <arpa/inet.h>
00025 #include <netinet/in.h>
00026 #include <unistd.h>
00027 #include <errno.h>
00028 #include <string.h>
00029 #include <list>
00030 
00031 #include "Network/Generic/network_delivery_impl.h"
00032 
00033 class CL_UnixPipeConnection : public CL_Connection
00034 {
00035         int read, write;
00036         bool is_connection_lost;
00037 
00038         unsigned long read_int();
00039         void read_data(void *dest, int size_data);
00040         void write_int(unsigned long value);
00041         inline void write_data(void *data, unsigned int size);
00042 
00043 public:
00044         CL_UnixPipeConnection(int read, int write);
00045         virtual ~CL_UnixPipeConnection();
00046 
00047         int get_socket() { return read; }
00048 
00049         // CL_Connection inherited functions
00050         virtual bool peek();
00051         virtual CL_ConnectionPacket receive();
00052         virtual void send(CL_ConnectionPacket message);
00053         virtual bool connection_lost();
00054 };
00055 
00056 
00057 #endif
00058 
00059 #endif // USE_NETWORK

Generated at Wed Apr 4 19:54:04 2001 for ClanLib by doxygen1.2.6 written by Dimitri van Heesch, © 1997-2001