sources/network/udpsocket.cpp

changeset 183
9b6a0daedfc0
parent 182
20ca0a6be175
child 186
9330b93d9946
equal deleted inserted replaced
182:20ca0a6be175 183:9b6a0daedfc0
122 reinterpret_cast<sockaddr*> (&claddr), &socklen); 122 reinterpret_cast<sockaddr*> (&claddr), &socklen);
123 123
124 if (length == -1) 124 if (length == -1)
125 { 125 {
126 if (errno != EWOULDBLOCK) 126 if (errno != EWOULDBLOCK)
127 m_error = String ("recvfrom error: ") + strerror (errno); 127 m_error = std::string ("recvfrom error: ") + strerror (errno);
128 128
129 return false; 129 return false;
130 } 130 }
131 131
132 unsigned char decodedPacket[MAX_DATAGRAM_LENGTH]; 132 unsigned char decodedPacket[MAX_DATAGRAM_LENGTH];
149 int res = ::sendto (m_socket, HuffmanBuffer, encodedlength, 0, 149 int res = ::sendto (m_socket, HuffmanBuffer, encodedlength, 0,
150 reinterpret_cast<sockaddr*> (&claddr), sizeof claddr); 150 reinterpret_cast<sockaddr*> (&claddr), sizeof claddr);
151 151
152 if (res == -1) 152 if (res == -1)
153 { 153 {
154 m_error = String ("Unable to launch packet: ") + strerror (errno); 154 m_error = std::string ("Unable to launch packet: ") + strerror (errno);
155 return false; 155 return false;
156 } 156 }
157 157
158 return true; 158 return true;
159 } 159 }

mercurial