Main Page   Class Hierarchy   Compound List   File List   Compound Members   File Members   Related Pages  

Socket.hpp

Go to the documentation of this file.
00001 #ifndef SOCKET_H
00002 #define SOCKET_H
00003 
00004 #include <sys/time.h>
00005 #include <sys/types.h>
00006 #include <sys/socket.h>
00007 #include <netinet/in.h>
00008 #include <unistd.h>
00009 
00013 const int MAX_WAITING = 5;
00014 
00018 class Socket {
00019  public:
00024         Socket();
00025 
00030         Socket(unsigned short port);
00031 
00036         ~Socket();
00037 
00041         void listen(unsigned short port);
00042 
00048         bool isPendingConnection (long timeout);
00049 
00050  private:
00054         struct sockaddr_in saddr;
00055 
00059         int so; 
00060 
00064         void init_socket(unsigned short port);
00065         
00069         void start_server();
00070 
00074         bool isValid();
00075 
00076 
00081         int accept();
00082 
00086         friend class TCPStream;
00087 };
00088 
00089 #endif

Generated on Sun Jan 20 20:59:59 2002 for bkmd by doxygen1.2.12 written by Dimitri van Heesch, © 1997-2001