sipxportlib  Version 3.3
OsSSLServerSocket.h
Go to the documentation of this file.
1 //
2 // Copyright (C) 2004-2006 SIPfoundry Inc.
3 // Licensed by SIPfoundry under the LGPL license.
4 //
5 // Copyright (C) 2004-2006 Pingtel Corp. All rights reserved.
6 // Licensed to SIPfoundry under a Contributor Agreement.
7 //
8 // $$
10 
11 
12 #ifndef _OsSSLServerSocket_h_
13 #define _OsSSLServerSocket_h_
14 
15 #ifdef HAVE_SSL
16 
17 // SYSTEM INCLUDES
18 //#include <...>
19 
20 // APPLICATION INCLUDES
21 #include <os/OsConnectionSocket.h>
22 #include <os/OsServerSocket.h>
24 #include <os/OsFS.h>
25 
26 // DEFINES
27 // MACROS
28 // EXTERNAL FUNCTIONS
29 // EXTERNAL VARIABLES
30 // CONSTANTS
31 // STRUCTS
32 // TYPEDEFS
33 // FORWARD DECLARATIONS
34 
36 class OsSSLServerSocket : public OsServerSocket
37 {
38 /* //////////////////////////// PUBLIC //////////////////////////////////// */
39 public:
40 
41 /* ============================ CREATORS ================================== */
42 
44  OsSSLServerSocket(int connectionQueueSize,
47  int serverPort=PORT_DEFAULT
50  );
56  OsSSLServerSocket& operator=(const OsSSLServerSocket& rhs);
58 
59  virtual
60  ~OsSSLServerSocket();
61  //:Destructor
62 
63 
64 /* ============================ MANIPULATORS ============================== */
65 
66  virtual OsConnectionSocket* accept();
67  //:Blocking accept of next connection
68  // Blocks and waits for the next TCP connection request.
71 
72 
73  void close();
74  //: Close down the server
75 
76 /* ============================ ACCESSORS ================================= */
77 
78  virtual int getLocalHostPort() const;
79  //:Return the local port number
80  // Returns the port to which this socket is bound on this host.
81 
82 /* ============================ INQUIRY =================================== */
83 
84  virtual OsSocket::IpProtocolSocketType getIpProtocol() const;
85  //: Returns the protocol type of this socket
86 
87  virtual UtlBoolean isOk() const;
88  //: Server socket is in ready to accept incoming conection requests.
89 
90  int isConnectionReady();
91  //: Poll to see if connections are waiting
94 
95 /* //////////////////////////// PROTECTED ///////////////////////////////// */
96 protected:
97 
98 /* //////////////////////////// PRIVATE /////////////////////////////////// */
99 private:
100 
101  static int pemPasswdCallbackFunc(char *buf, int size, int rwflag, void *userdata);
102  //:Callback used to set the private key password for decrypting the key
103  //:buf is the buffer to fill with a password
104  //:size is the maximum size of the buffer
105 
106  OsSSLServerSocket(const OsSSLServerSocket& rOsSSLServerSocket);
107  //:Disable copy constructor
108 
109  OsSSLServerSocket();
110  //:Disable default constructor
111 
112 };
113 
114 /* ============================ INLINE METHODS ============================ */
115 
116 #endif // HAVE_SSL
117 
118 #endif // _OsSSLServerSocket_h_
119 
IpProtocolSocketType
Definition: OsSocket.h:92
int isConnectionReady()
virtual UtlBoolean isOk() const
Definition: OsServerSocket.cpp:279
virtual void close()
returns: Returns a socket connected to the client requesting the returns: connection. If an error occurs returns NULL.
Definition: OsServerSocket.cpp:234
virtual int getLocalHostPort() const
Definition: OsServerSocket.cpp:267
virtual OsConnectionSocket * accept()
Definition: OsServerSocket.cpp:205
Definition: OsConnectionSocket.h:34
int UtlBoolean
Definition: UtlDefs.h:41
Definition: OsServerSocket.h:38
#define PORT_DEFAULT
Definition: OsDefs.h:180
OsServerSocket & operator=(const OsServerSocket &rhs)
param: connectionQueueSize - The maximum number of outstanding
Definition: OsServerSocket.cpp:197