mirror of
https://github.com/pocoproject/poco.git
synced 2025-10-30 21:50:47 +01:00
NetSSL library refactoring
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
//
|
||||
// DatagramSocket.h
|
||||
//
|
||||
// $Id: //poco/svn/Net/include/Poco/Net/DatagramSocket.h#2 $
|
||||
// $Id: //poco/Main/Net/include/Poco/Net/DatagramSocket.h#3 $
|
||||
//
|
||||
// Library: Net
|
||||
// Package: Sockets
|
||||
@@ -56,7 +56,7 @@ public:
|
||||
DatagramSocket();
|
||||
/// Creates an unconnected IPv4 datagram socket.
|
||||
|
||||
DatagramSocket(IPAddress::Family family);
|
||||
explicit DatagramSocket(IPAddress::Family family);
|
||||
/// Creates an unconnected datagram socket.
|
||||
///
|
||||
/// The socket will be created for the
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
//
|
||||
// DialogSocket.h
|
||||
//
|
||||
// $Id: //poco/svn/Net/include/Poco/Net/DialogSocket.h#2 $
|
||||
// $Id: //poco/Main/Net/include/Poco/Net/DialogSocket.h#3 $
|
||||
//
|
||||
// Library: Net
|
||||
// Package: Sockets
|
||||
@@ -70,7 +70,7 @@ public:
|
||||
/// Before sending or receiving data, the socket
|
||||
/// must be connected with a call to connect().
|
||||
|
||||
DialogSocket(const SocketAddress& address);
|
||||
explicit DialogSocket(const SocketAddress& address);
|
||||
/// Creates a stream socket and connects it to
|
||||
/// the socket specified by address.
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
//
|
||||
// HTTPClientSession.h
|
||||
//
|
||||
// $Id: //poco/svn/Net/include/Poco/Net/HTTPClientSession.h#2 $
|
||||
// $Id: //poco/Main/Net/include/Poco/Net/HTTPClientSession.h#7 $
|
||||
//
|
||||
// Library: Net
|
||||
// Package: HTTPClient
|
||||
@@ -169,8 +169,9 @@ protected:
|
||||
int write(const char* buffer, std::streamsize length);
|
||||
/// Tries to re-connect if keep-alive is on.
|
||||
|
||||
virtual std::string getHostInfo() const;
|
||||
/// Returns the target host and port number for proxy requests.
|
||||
virtual std::string proxyRequestPrefix() const;
|
||||
/// Returns the prefix prepended to the URI for proxy requests
|
||||
/// (e.g., "http://myhost.com").
|
||||
|
||||
void deleteResponseStream();
|
||||
/// Deletes the response stream and sets it to 0.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
//
|
||||
// HTTPSession.h
|
||||
//
|
||||
// $Id: //poco/Main/Net/include/Poco/Net/HTTPSession.h#5 $
|
||||
// $Id: //poco/Main/Net/include/Poco/Net/HTTPSession.h#7 $
|
||||
//
|
||||
// Library: Net
|
||||
// Package: HTTP
|
||||
@@ -96,7 +96,13 @@ public:
|
||||
{
|
||||
HTTP_PORT = 80
|
||||
};
|
||||
|
||||
|
||||
StreamSocket detachSocket();
|
||||
/// Detaches the socket from the session.
|
||||
///
|
||||
/// The socket is returned, and a new, uninitialized socket is
|
||||
/// attached to the session.
|
||||
|
||||
protected:
|
||||
HTTPSession();
|
||||
/// Creates a HTTP session using an
|
||||
@@ -154,12 +160,16 @@ protected:
|
||||
/// Connects the underlying socket to the given address
|
||||
/// and sets the socket's receive timeout.
|
||||
|
||||
void attachSocket(const StreamSocket& socket);
|
||||
/// Attaches a socket to the session, replacing the
|
||||
/// previously attached socket.
|
||||
|
||||
void close();
|
||||
/// Closes the underlying socket.
|
||||
|
||||
void setException(const Poco::Exception& exc);
|
||||
/// Stores a clone of the exception.
|
||||
|
||||
|
||||
private:
|
||||
enum
|
||||
{
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
//
|
||||
// HTTPStreamFactory.h
|
||||
//
|
||||
// $Id: //poco/svn/Net/include/Poco/Net/HTTPStreamFactory.h#2 $
|
||||
// $Id: //poco/Main/Net/include/Poco/Net/HTTPStreamFactory.h#3 $
|
||||
//
|
||||
// Library: Net
|
||||
// Package: HTTP
|
||||
@@ -83,6 +83,10 @@ public:
|
||||
static void registerFactory();
|
||||
/// Registers the HTTPStreamFactory with the
|
||||
/// default URIStreamOpener instance.
|
||||
|
||||
static void unregisterFactory();
|
||||
/// Unregisters the HTTPStreamFactory with the
|
||||
/// default URIStreamOpener instance.
|
||||
|
||||
private:
|
||||
enum
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
//
|
||||
// MulticastSocket.h
|
||||
//
|
||||
// $Id: //poco/svn/Net/include/Poco/Net/MulticastSocket.h#2 $
|
||||
// $Id: //poco/Main/Net/include/Poco/Net/MulticastSocket.h#3 $
|
||||
//
|
||||
// Library: Net
|
||||
// Package: Sockets
|
||||
@@ -58,7 +58,7 @@ public:
|
||||
MulticastSocket();
|
||||
/// Creates the MulticastSocket.
|
||||
|
||||
MulticastSocket(IPAddress::Family family);
|
||||
explicit MulticastSocket(IPAddress::Family family);
|
||||
/// Creates an unconnected datagram socket.
|
||||
///
|
||||
/// The socket will be created for the
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
//
|
||||
// POP3ClientSession.h
|
||||
//
|
||||
// $Id: //poco/svn/Net/include/Poco/Net/POP3ClientSession.h#2 $
|
||||
// $Id: //poco/Main/Net/include/Poco/Net/POP3ClientSession.h#3 $
|
||||
//
|
||||
// Library: Net
|
||||
// Package: Mail
|
||||
@@ -76,7 +76,7 @@ public:
|
||||
|
||||
typedef std::vector<MessageInfo> MessageInfoVec;
|
||||
|
||||
POP3ClientSession(const StreamSocket& socket);
|
||||
explicit POP3ClientSession(const StreamSocket& socket);
|
||||
/// Creates the POP3ClientSession using
|
||||
/// the given socket, which must be connected
|
||||
/// to a POP3 server.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
//
|
||||
// SMTPClientSession.h
|
||||
//
|
||||
// $Id: //poco/Main/Net/include/Poco/Net/SMTPClientSession.h#4 $
|
||||
// $Id: //poco/Main/Net/include/Poco/Net/SMTPClientSession.h#5 $
|
||||
//
|
||||
// Library: Net
|
||||
// Package: Mail
|
||||
@@ -67,10 +67,10 @@ public:
|
||||
{
|
||||
AUTH_NONE,
|
||||
AUTH_CRAM_MD5,
|
||||
AUTH_LOGIN
|
||||
AUTH_LOGIN,
|
||||
};
|
||||
|
||||
SMTPClientSession(const StreamSocket& socket);
|
||||
explicit SMTPClientSession(const StreamSocket& socket);
|
||||
/// Creates the SMTPClientSession using
|
||||
/// the given socket, which must be connected
|
||||
/// to a SMTP server.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
//
|
||||
// SocketAcceptor.h
|
||||
//
|
||||
// $Id: //poco/svn/Net/include/Poco/Net/SocketAcceptor.h#2 $
|
||||
// $Id: //poco/Main/Net/include/Poco/Net/SocketAcceptor.h#3 $
|
||||
//
|
||||
// Library: Net
|
||||
// Package: Reactor
|
||||
@@ -89,7 +89,7 @@ class SocketAcceptor
|
||||
/// if special steps are necessary to create a ServiceHandler object.
|
||||
{
|
||||
public:
|
||||
SocketAcceptor(ServerSocket& socket):
|
||||
explicit SocketAcceptor(ServerSocket& socket):
|
||||
_socket(socket),
|
||||
_pReactor(0)
|
||||
/// Creates an SocketAcceptor, using the given ServerSocket.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
//
|
||||
// SocketConnector.h
|
||||
//
|
||||
// $Id: //poco/svn/Net/include/Poco/Net/SocketConnector.h#2 $
|
||||
// $Id: //poco/Main/Net/include/Poco/Net/SocketConnector.h#3 $
|
||||
//
|
||||
// Library: Net
|
||||
// Package: Reactor
|
||||
@@ -93,7 +93,7 @@ class SocketConnector
|
||||
/// if special steps are necessary to create a ServiceHandler object.
|
||||
{
|
||||
public:
|
||||
SocketConnector(SocketAddress& address):
|
||||
explicit SocketConnector(SocketAddress& address):
|
||||
_pReactor(0)
|
||||
/// Creates a SocketConnector, using the given Socket.
|
||||
{
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
//
|
||||
// SocketImpl.h
|
||||
//
|
||||
// $Id: //poco/svn/Net/include/Poco/Net/SocketImpl.h#3 $
|
||||
// $Id: //poco/Main/Net/include/Poco/Net/SocketImpl.h#6 $
|
||||
//
|
||||
// Library: Net
|
||||
// Package: Sockets
|
||||
@@ -335,7 +335,7 @@ public:
|
||||
int socketError();
|
||||
/// Returns the value of the SO_ERROR socket option.
|
||||
|
||||
poco_socket_t sockfd();
|
||||
poco_socket_t sockfd() const;
|
||||
/// Returns the socket descriptor for the
|
||||
/// underlying native socket.
|
||||
|
||||
@@ -383,13 +383,9 @@ protected:
|
||||
/// The third argument, proto, is normally set to 0,
|
||||
/// except for raw sockets.
|
||||
|
||||
void setSockfd(poco_socket_t aSocket);
|
||||
void reset(poco_socket_t fd = POCO_INVALID_SOCKET);
|
||||
/// Allows subclasses to set the socket manually, iff no valid socket is set yet!
|
||||
|
||||
void invalidate();
|
||||
/// Sets a socket to POCO_INVALID_SOCKET. It is assumed that the socket was closed
|
||||
/// via a prior operation.
|
||||
|
||||
static int lastError();
|
||||
/// Returns the last error code.
|
||||
|
||||
@@ -424,7 +420,7 @@ private:
|
||||
//
|
||||
// inlines
|
||||
//
|
||||
inline poco_socket_t SocketImpl::sockfd()
|
||||
inline poco_socket_t SocketImpl::sockfd() const
|
||||
{
|
||||
return _sockfd;
|
||||
}
|
||||
@@ -446,12 +442,6 @@ inline int SocketImpl::lastError()
|
||||
}
|
||||
|
||||
|
||||
inline void SocketImpl::invalidate()
|
||||
{
|
||||
_sockfd = POCO_INVALID_SOCKET;
|
||||
}
|
||||
|
||||
|
||||
inline bool SocketImpl::getBlocking() const
|
||||
{
|
||||
return _blocking;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
//
|
||||
// SocketNotification.h
|
||||
//
|
||||
// $Id: //poco/1.3/Net/include/Poco/Net/SocketNotification.h#2 $
|
||||
// $Id: //poco/Main/Net/include/Poco/Net/SocketNotification.h#4 $
|
||||
//
|
||||
// Library: Net
|
||||
// Package: Reactor
|
||||
@@ -57,7 +57,7 @@ class Net_API SocketNotification: public Poco::Notification
|
||||
/// the SocketReactor.
|
||||
{
|
||||
public:
|
||||
SocketNotification(SocketReactor* pReactor);
|
||||
explicit SocketNotification(SocketReactor* pReactor);
|
||||
/// Creates the SocketNotification for the given SocketReactor.
|
||||
|
||||
virtual ~SocketNotification();
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
//
|
||||
// SocketNotifier.h
|
||||
//
|
||||
// $Id: //poco/svn/Net/include/Poco/Net/SocketNotifier.h#2 $
|
||||
// $Id: //poco/Main/Net/include/Poco/Net/SocketNotifier.h#3 $
|
||||
//
|
||||
// Library: Net
|
||||
// Package: Reactor
|
||||
@@ -62,7 +62,7 @@ class Net_API SocketNotifier: public Poco::RefCountedObject
|
||||
/// to notify registered event handlers of socket events.
|
||||
{
|
||||
public:
|
||||
SocketNotifier(const Socket& socket);
|
||||
explicit SocketNotifier(const Socket& socket);
|
||||
/// Creates the SocketNotifier for the given socket.
|
||||
|
||||
void addObserver(SocketReactor* pReactor, const Poco::AbstractObserver& observer);
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
//
|
||||
// SocketReactor.h
|
||||
//
|
||||
// $Id: //poco/1.3/Net/include/Poco/Net/SocketReactor.h#2 $
|
||||
// $Id: //poco/Main/Net/include/Poco/Net/SocketReactor.h#5 $
|
||||
//
|
||||
// Library: Net
|
||||
// Package: Reactor
|
||||
@@ -132,7 +132,7 @@ public:
|
||||
SocketReactor();
|
||||
/// Creates the SocketReactor.
|
||||
|
||||
SocketReactor(const Poco::Timespan& timeout);
|
||||
explicit SocketReactor(const Poco::Timespan& timeout);
|
||||
/// Creates the SocketReactor, using the given timeout.
|
||||
|
||||
virtual ~SocketReactor();
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
//
|
||||
// SocketStream.h
|
||||
//
|
||||
// $Id: //poco/svn/Net/include/Poco/Net/SocketStream.h#2 $
|
||||
// $Id: //poco/Main/Net/include/Poco/Net/SocketStream.h#3 $
|
||||
//
|
||||
// Library: Net
|
||||
// Package: Sockets
|
||||
@@ -121,7 +121,7 @@ class Net_API SocketOutputStream: public SocketIOS, public std::ostream
|
||||
/// An output stream for writing to a socket.
|
||||
{
|
||||
public:
|
||||
SocketOutputStream(const Socket& socket);
|
||||
explicit SocketOutputStream(const Socket& socket);
|
||||
/// Creates the SocketOutputStream with the given socket.
|
||||
///
|
||||
/// The socket's SocketImpl must be a StreamSocketImpl,
|
||||
@@ -147,7 +147,7 @@ class Net_API SocketInputStream: public SocketIOS, public std::istream
|
||||
/// istream with formatted reads.
|
||||
{
|
||||
public:
|
||||
SocketInputStream(const Socket& socket);
|
||||
explicit SocketInputStream(const Socket& socket);
|
||||
/// Creates the SocketInputStream with the given socket.
|
||||
///
|
||||
/// The socket's SocketImpl must be a StreamSocketImpl,
|
||||
@@ -171,7 +171,7 @@ class Net_API SocketStream: public SocketIOS, public std::iostream
|
||||
/// istream with formatted reads.
|
||||
{
|
||||
public:
|
||||
SocketStream(const Socket& socket);
|
||||
explicit SocketStream(const Socket& socket);
|
||||
/// Creates the SocketStream with the given socket.
|
||||
///
|
||||
/// The socket's SocketImpl must be a StreamSocketImpl,
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
//
|
||||
// StreamSocket.h
|
||||
//
|
||||
// $Id: //poco/svn/Net/include/Poco/Net/StreamSocket.h#2 $
|
||||
// $Id: //poco/Main/Net/include/Poco/Net/StreamSocket.h#3 $
|
||||
//
|
||||
// Library: Net
|
||||
// Package: Sockets
|
||||
@@ -62,7 +62,7 @@ public:
|
||||
/// Before sending or receiving data, the socket
|
||||
/// must be connected with a call to connect().
|
||||
|
||||
StreamSocket(const SocketAddress& address);
|
||||
explicit StreamSocket(const SocketAddress& address);
|
||||
/// Creates a stream socket and connects it to
|
||||
/// the socket specified by address.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user