#include <iostream>
#include <vector>
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <cstring>
#include <winsock2.h>
#include <ws2tcpip.h>
#include "binding.hpp"
HDE::binding::binding(int domain, int service, int protocol, u_long IP): server(domain, service, protocol, IP)
{
set_connection(establish_net_link(get_sock(), get_address()));
test_connection(get_connection());
}
int HDE::binding::establish_net_link(int sock, struct sockaddr_in address)
{
return bind(sock, (struct sockaddr *)&address, sizeof(address));
}