Move definition of socket_t to util.hh

It's used in multiple places so dedicated place for its definition
is necessary
This commit is contained in:
Aaro Altonen 2020-01-17 13:41:52 +02:00
parent 4370119140
commit 8ebadad579
4 changed files with 9 additions and 4 deletions

View File

@ -91,7 +91,7 @@ rtp_format_t kvz_rtp::connection::get_payload() const
return rtp_payload_;
}
kvz_rtp::socket_t kvz_rtp::connection::get_raw_socket()
socket_t kvz_rtp::connection::get_raw_socket()
{
return socket_.get_raw_socket();
}

View File

@ -18,6 +18,7 @@ using namespace mingw;
#include "debug.hh"
#include "socket.hh"
#include "util.hh"
kvz_rtp::socket::socket():
recv_handler_(nullptr),
@ -117,7 +118,7 @@ void kvz_rtp::socket::set_sockaddr(sockaddr_in addr)
addr_ = addr;
}
kvz_rtp::socket_t& kvz_rtp::socket::get_raw_socket()
socket_t& kvz_rtp::socket::get_raw_socket()
{
return socket_;
}

View File

@ -18,11 +18,9 @@
namespace kvz_rtp {
#ifdef _WIN32
typedef SOCKET socket_t;
typedef unsigned socklen_t;
typedef TRANSMIT_PACKETS_ELEMENT vecio_buf;
#else
typedef int socket_t;
typedef mmsghdr vecio_buf;
#endif

View File

@ -22,6 +22,12 @@
#define PACKED_STRUCT(name) struct name
#endif
#ifdef _WIN32
typedef SOCKET socket_t;
#else
typedef int socket_t;
#endif
const int MAX_PACKET = 65536;
const int MAX_PAYLOAD = 1441;