1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-06-01 02:28:12 +00:00

IPv4: More hacking on bringing up TCP support.

This was a bit more complicated than I expected, but it's moving forward.
This commit is contained in:
Andreas Kling 2019-03-13 23:14:30 +01:00
parent 7aba68d51c
commit 032d9d7065
7 changed files with 193 additions and 33 deletions

View file

@ -51,11 +51,13 @@ int main(int argc, char** argv)
char buffer[BUFSIZ];
const char* msg = "Test message";
send(fd, (const char*)msg, strlen(msg), 0);
rc = send(fd, (const char*)msg, strlen(msg), 0);
if (rc < 0) {
perror("send");
return 1;
}
printf("Message sent.\n");
struct sockaddr_in src_addr;
socklen_t src_addr_len = sizeof(src_addr);
ssize_t nrecv = recv(fd, buffer, sizeof(buffer), 0);
if (nrecv < 0) {
perror("recvfrom");