sources/network/udpsocket.cpp

changeset 56
b4caacf567af
parent 31
b5b5a6a96d91
child 73
07dda51a7a8e
equal deleted inserted replaced
55:79e5460a8a56 56:b4caacf567af
32 #include <sys/types.h> 32 #include <sys/types.h>
33 #include <sys/time.h> 33 #include <sys/time.h>
34 #include <netinet/in.h> 34 #include <netinet/in.h>
35 #include <string.h> 35 #include <string.h>
36 #include <fcntl.h> 36 #include <fcntl.h>
37 #include <unistd.h>
37 #include "udpsocket.h" 38 #include "udpsocket.h"
38 #include "../huffman/huffman.h" 39 #include "../huffman/huffman.h"
39 40
40 static unsigned char g_huffmanBuffer[131072]; 41 static unsigned char g_huffmanBuffer[131072];
41 42
44 UDPSocket::UDPSocket() : 45 UDPSocket::UDPSocket() :
45 m_socket (socket (AF_INET, SOCK_DGRAM, IPPROTO_UDP)) {} 46 m_socket (socket (AF_INET, SOCK_DGRAM, IPPROTO_UDP)) {}
46 47
47 // ----------------------------------------------------------------------------- 48 // -----------------------------------------------------------------------------
48 // 49 //
49 UDPSocket::~UDPSocket() {} 50 UDPSocket::~UDPSocket()
51 {
52 close (m_socket);
53 }
50 54
51 // ------------------------------------------------------------------------------------------------- 55 // -------------------------------------------------------------------------------------------------
52 // 56 //
53 METHOD 57 METHOD
54 UDPSocket::set_blocking (bool a) -> bool 58 UDPSocket::set_blocking (bool a) -> bool

mercurial