Sponge
CS144's user-space TCP library
|
Go to the source code of this file.
Functions | |
sock1 | bind (Address("127.0.0.1", portnum)) |
sock1 | close () |
sock2 | connect (Address("127.0.0.1", portnum)) |
if (recvd !="hi there"||recvd2 !="hi yourself") | |
sock1 | listen (1) |
sock3 | shutdown (SHUT_RDWR) |
sock3 | write ("hi there") |
sock2 | write ("hi yourself") |
Variables | |
const uint16_t | portnum = ((std::random_device()()) % 50000) + 1025 |
auto | recvd = sock2.read() |
auto | recvd2 = sock3.read() |
TCPSocket | sock1 |
TCPSocket | sock2 |
auto | sock3 = sock1.accept() |
sock2 close | ( | ) |
if | ( | recvd ! | = "hi there" || recvd2 != "hi yourself" | ) |
Definition at line 24 of file socket_example_2.cc.
sock1 listen | ( | 1 | ) |
sock3 shutdown | ( | SHUT_RDWR | ) |
sock3 write | ( | "hi there" | ) |
sock2 write | ( | "hi yourself" | ) |
const uint16_t portnum = ((std::random_device()()) % 50000) + 1025 |
Definition at line 1 of file socket_example_2.cc.
auto recvd = sock2.read() |
Definition at line 16 of file socket_example_2.cc.
auto recvd2 = sock3.read() |
Definition at line 19 of file socket_example_2.cc.
TCPSocket sock1 |
Definition at line 4 of file socket_example_2.cc.
TCPSocket sock2 |
Definition at line 9 of file socket_example_2.cc.
auto sock3 = sock1.accept() |
Definition at line 13 of file socket_example_2.cc.