Main Page   Packages   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Search  

C:/temp/src/j2k/Net/ServerSocket.hpp

Go to the documentation of this file.
00001 // Wolf for J2K Library
00002 // LGPL Licensed.
00003 // http://j2k.sourceforge.net/
00004 // Revision #1: Fred P. - Oct 2nd, 2001
00005 
00006 #ifndef __J2K__NET__SERVERSOCKET_HPP__
00007 #define __J2K__NET__SERVERSOCKET_HPP__
00008 
00009 //This class implements a generic Listening Socket (defaults to TCP/IP),
00010 //and is used as a baseclass for specific typs of sockets
00011 
00012 #include <j2k/Net/Socket.hpp>
00013 #include <j2k/Net/include.hpp>
00014 
00015 class ServerSocket {
00016 protected: // to disallow creation of ServerSocket Objects
00017 
00018 //public:
00019 
00020   ServerSocket(sockaddr* sa = NULL, int domain = PF_INET, int type = SOCK_STREAM, int protocol = 0) throw(int);
00021   ServerSocket(ServerSocket& original) throw(int);
00022 
00023  public:  
00024   int bind(struct sockaddr* sa = NULL);    //if sa is not NULL, it will override local_sa
00025   int listen(int bklog = 4);
00026 
00027   Socket* accept() throw(int);
00028 
00029   void close();
00030   void shutdownInput();
00031   void shutdownOutput();
00032   void shutdown(int how = 2);
00033   
00034   struct sockaddr* getSockAddr();
00035   int getSocket();
00036   int getDomain();
00037   int getType();
00038   int getProtocol();
00039 
00040   int   setSockOpt(int level, int optname, void* optval, socklen_t  optlen);
00041   void* getSockOpt(int level, int optname, void* optval, socklen_t* optlen);
00042   
00043  protected:
00044   int s_domain;
00045   int s_type;
00046   int s_protocol;
00047   struct sockaddr *lsa;
00048   struct sockaddr local_sa;
00049   int sck;
00050   int backlog;
00051 };
00052 
00053 #endif // __J2K__NET__SERVERSOCKET_HPP__
00054 

Generated on Sun Oct 14 18:46:33 2001 for Standard J2K Library by doxygen1.2.11.1 written by Dimitri van Heesch, © 1997-2001