Skip to content

Commit 34b48b8

Browse files
author
Artiom N.
committed
Some fixes
1 parent 88f9713 commit 34b48b8

File tree

4 files changed

+5
-4
lines changed

4 files changed

+5
-4
lines changed

src/book01/ch22/cpp/raw_sniffer/sniffer.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ bool Sniffer::bind_socket()
103103

104104
// Bind the socket to the specified IP address.
105105
const auto iface_addr = get_if_address(if_name_, sock_);
106-
if (-1 == bind(sock_, reinterpret_cast<const struct sockaddr*>(&iface_addr), sizeof(iface_addr)))
106+
if (-1 == bind(sock_, reinterpret_cast<const sockaddr*>(&iface_addr), sizeof(iface_addr)))
107107
{
108108
std::cerr << "bind() failed: " << sock_wrap_.get_last_error_string() << "." << std::endl;
109109
return false;

src/book02/ch01/cpp/broadcast_server/main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
#include <thread>
1111

1212

13-
const size_t buffer_size = 256;
13+
constexpr size_t buffer_size = 256;
1414

1515

1616
int main(int argc, char const* const argv[])

src/book02/ch01/python/client-to-client.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@
2727
continue
2828

2929
while True:
30-
data = f'I\'am {sock.getsockname()} sending data to ' f'{sock.getpeername()}'
30+
data = f'I\'am {sock.getsockname()} ' \
31+
f'sending data to ' f'{sock.getpeername()}'
3132
print(f'Sending "{data}"')
3233
sock.send(data.encode())
3334
print('Receiving...')

src/socket_wrapper/src/socket.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Socket::Socket(int domain, int type, int protocol) : socket_descriptor_(INVALID_
2222
Socket::Socket(SocketDescriptorType socket_descriptor) : socket_descriptor_(socket_descriptor) {}
2323

2424

25-
Socket::Socket(Socket &&s)
25+
Socket::Socket(Socket &&s) noexcept
2626
{
2727
socket_descriptor_ = s.socket_descriptor_;
2828
s.socket_descriptor_ = INVALID_SOCKET;

0 commit comments

Comments
 (0)