/* Blinker
Copyright 2011-2019 Stefan Schuermans <stefan@blinkenarea.org>
Copyleft GNU public license - http://www.gnu.org/copyleft/gpl.html
a blinkenarea.org project */
#ifndef UDP6SOCK_H
#define UDP6SOCK_H
#include <winsock2.h>
#include <string>
#include "Io.h"
#include "Udp6Addr.h"
namespace Blinker {
/**
* @brief UDP v6 socket
*
* UDP v6 socket in non-blocking mode with address re-usage enabled
*/
class Udp6Sock: public Io
{
public:
/// constructor
Udp6Sock();
/// destructor
~Udp6Sock();
private:
/// copy constructor disabled
Udp6Sock(const Udp6Sock &that);
/// assignment operator disabled
const Udp6Sock & operator=(const Udp6Sock &that);
public:
/**
* @brief get address the socket is bound to
* @param[out] addr local addess the socket is bound to
* @return if local address could be obtained
*/
bool getAddr(Udp6Addr &addr);
/**
* @brief bind socket
* @param[in] addr local address to bind to
* @return if binding succeeded
*/
bool bind(const Udp6Addr &addr);