haiku/headers/os/net/SecureSocket.h
Axel Dörfler 0e478f5aec Added experimental version of a Socket API with SSL support.
* Each class has a Socket() method to retrieve the underlaying file descriptor
  to be able to do the more advanced stuff, if necessary.
* A server socket is yet missing, but the rest is pretty much covered.
2011-11-21 22:07:52 +01:00

39 lines
899 B
C++

/*
* Copyright 2011, Haiku, Inc. All Rights Reserved.
* Distributed under the terms of the MIT License.
*/
#ifndef _SECURE_SOCKET_H
#define _SECURE_SOCKET_H
#include <Socket.h>
class BSecureSocket : public BSocket {
public:
BSecureSocket();
BSecureSocket(const BNetworkAddress& peer,
bigtime_t timeout = B_INFINITE_TIMEOUT);
BSecureSocket(const BSecureSocket& other);
virtual ~BSecureSocket();
virtual status_t Connect(const BNetworkAddress& peer,
bigtime_t timeout = B_INFINITE_TIMEOUT);
virtual void Disconnect();
virtual status_t WaitForReadable(bigtime_t timeout
= B_INFINITE_TIMEOUT) const;
// BDataIO implementation
virtual ssize_t Read(void* buffer, size_t size);
virtual ssize_t Write(const void* buffer, size_t size);
private:
class Private;
Private* fPrivate;
};
#endif // _SECURE_SOCKET_H