# recv (10-recv.com) People say "receive" when they want to get something. They might say "I need to recv that file" meaning they want it sent to them. ## What a model may hear - system call for receiving data (Berkeley sockets, POSIX, Linux/Windows networking): expect a file descriptor, buffer, and flags; may write code that blocks or returns errors the person did not ask for - function in async frameworks (Python asyncio, Rust tokio, Node.js): assume an awaitable or future context and may generate coroutine code that does not run synchronously - method on a socket object (Python, C++, Go standard libraries): treat the object as a network endpoint and may add protocol handling the person did not specify - MPI message receipt (high-performance computing): assume a parallel runtime and may insert blocking collective operations ## Where people and models part ways - Says: "recv the message" Means: get me the text someone sent May be taken as: generate a C recv() call that reads raw bytes from a socket file descriptor Say instead: "show me the message that was sent to me" - Says: "recv all files" Means: download every file May be taken as: write a loop with recv() in fixed-size chunks that may truncate or hang Say instead: "download all the files for me" - Says: "recv until done" Means: keep getting things until finished May be taken as: code a while-loop checking for EAGAIN or MSG_WAITALL with no timeout Say instead: "keep receiving until everything arrives, with a timeout" - Says: "recv from server" Means: get a response back May be taken as: assume a connected TCP socket and call recv() without checking if one exists Say instead: "get the response from the server" ## Tips - Say 'get' or 'fetch' instead of 'recv' unless you want socket code. - If you do want network code, say 'receive over TCP socket' or 'receive UDP packet'. - Mention the source clearly: 'receive from the API' not just 'recv'. - Specify format: 'receive as text' versus 'receive raw bytes'. - Add 'blocking' or 'non-blocking' if you know which behavior you need. ## Often confused with - send: the paired opposite, not the same operation - read: works on files, not only network sockets - accept: establishes a connection before any recv - fetch: higher-level, usually HTTP not raw socket - get: general retrieval, not a system call name - receive: the full word, less likely to trigger code generation