See the manpage [here](https://man7.org/linux/man-pages/man2/recv.2.html) for C. See [here](https://docs.python.org/3/library/socket.html#:~:text=socket.recv) for Python. The `recv()` call is (normally) only used on a connected socket. ## C From the manpage ```c #include ssize_t recv(int sockfd, void *buf, size_t len, int flags); ssize_t recvfrom(int sockfd, void *restrict buf, size_t len, int flags, struct sockaddr *restrict src_addr, socklen_t *restrict addrlen); ssize_t recvmsg(int sockfd, struct msghdr *msg, int flags); ``` The **return value** is: * the number of bytes received, if positive; * zero for when a socket has performed an orderly shutdown * -1 on error. ## Python Basically the same as C, except ```python import socket s = socket.socket(...) number_of_bytes = s.recv(size_of_buffer) ```