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 | connect (recvd.source_address) |
if (recvd.payload !="hi there"||recvd2.payload !="hi yourself") | |
sock1 | send ("hi yourself") |
sock2 | sendto (Address("127.0.0.1", portnum), "hi there") |
Variables | |
const uint16_t | portnum = ((std::random_device()()) % 50000) + 1025 |
auto | recvd = sock1.recv() |
auto | recvd2 = sock2.recv() |
UDPSocket | sock1 |
UDPSocket | sock2 |
sock1 connect | ( | recvd. | source_address | ) |
if | ( | recvd.payload ! | = "hi there" || recvd2.payload != "hi yourself" | ) |
Definition at line 18 of file socket_example_1.cc.
sock1 send | ( | "hi yourself" | ) |
const uint16_t portnum = ((std::random_device()()) % 50000) + 1025 |
Definition at line 1 of file socket_example_1.cc.
auto recvd = sock1.recv() |
Definition at line 12 of file socket_example_1.cc.
auto recvd2 = sock2.recv() |
Definition at line 16 of file socket_example_1.cc.
UDPSocket sock1 |
Definition at line 4 of file socket_example_1.cc.
UDPSocket sock2 |
Definition at line 8 of file socket_example_1.cc.