Sponge
CS144's user-space TCP library
|
Go to the source code of this file.
Functions | |
if (recvd !="hi there"||recvd2 !="hi yourself") | |
SystemCall ("socketpair", ::socketpair(AF_UNIX, SOCK_STREAM, 0, fds.data())) | |
pipe1 | write ("hi there") |
pipe2 | write ("hi yourself") |
Variables | |
std::array< int, 2 > | fds {} |
LocalStreamSocket | pipe1 {FileDescriptor(fds[0])} |
LocalStreamSocket | pipe2 {FileDescriptor(fds[1])} |
auto | recvd = pipe2.read() |
auto | recvd2 = pipe1.read() |
if | ( | recvd ! | = "hi there" || recvd2 != "hi yourself" | ) |
Definition at line 12 of file socket_example_3.cc.
SystemCall | ( | "socketpair" | , |
::socketpair(AF_UNIX, SOCK_STREAM, 0, fds.data()) | |||
) |
pipe1 write | ( | "hi there" | ) |
pipe2 write | ( | "hi yourself" | ) |
std::array<int, 2> fds {} |
Definition at line 2 of file socket_example_3.cc.
LocalStreamSocket pipe1 {FileDescriptor(fds[0])} |
Definition at line 4 of file socket_example_3.cc.
LocalStreamSocket pipe2 {FileDescriptor(fds[1])} |
Definition at line 4 of file socket_example_3.cc.
auto recvd = pipe2.read() |
Definition at line 7 of file socket_example_3.cc.
auto recvd2 = pipe1.read() |
Definition at line 10 of file socket_example_3.cc.