#ifndef MSP_NET_CLIENTSOCKET_H_
#define MSP_NET_CLIENTSOCKET_H_
+#include "mspnet_api.h"
#include "socket.h"
namespace Msp {
/**
ClientSockets are used for sending and receiving data over the network.
*/
-class ClientSocket: public Socket
+class MSPNET_API ClientSocket: public Socket
{
public:
/** Emitted when the socket finishes connecting. */
sigc::signal<void, const std::exception *> signal_connect_finished;
protected:
- bool connecting;
- bool connected;
- SockAddr *peer_addr;
+ bool connecting = false;
+ bool connected = false;
+ std::unique_ptr<SockAddr> peer_addr;
ClientSocket(const Private &, const SockAddr &);
ClientSocket(Family, int, int);
const SockAddr &get_peer_address() const;
protected:
- virtual unsigned do_write(const char *, unsigned);
- virtual unsigned do_read(char *, unsigned);
+ std::size_t do_write(const char *, std::size_t) override;
+ std::size_t do_read(char *, std::size_t) override;
};
} // namespace Net