BSD Sockets function used for receiving data from a TCP socket.
Questions tagged [recv]
670 questions
3
votes
4 answers
Problem with recv() on a tcp connection
I am simulating TCP communication on windows in C.
I have sender and a receiver communicating.
The sender sends packets of specific size to the receiver. The receiver gets them and sends an ACK for each packet it received back to the sender.
If the…

Michael
- 22,196
- 33
- 132
- 187
3
votes
1 answer
EBADF while recv after epoll_wait
i've got a following problem: i have a epoll code which receives connections:
while (1) {
int nfds = epoll_wait(epollfd, events, 4096, -1);
if (nfds == -1) {
if (errno == EINTR)
continue;
perror("epoll_wait");
…

milo
- 1,220
- 3
- 17
- 33
3
votes
3 answers
EAGAIN on recv()
I implented a socket client to communicate to an ip camera with RTSP over HTTP to get teh video from the camera.
To stablished the communication with the camera, first i have to set an HTTP-GET tunnel, then send the RTSP commands. When the camera…

user586832
- 31
- 1
- 1
- 3
3
votes
1 answer
Socket recv (blocking) fails with errno EAGAIN - resource temporarily unavailable
I am implementing a UNIX domain socket Inter Process communication code and I hit this error randomly - "errno 11: Resource temporarily unavailable" while trying to read from the socket. I use MSG_PEEK to read the number of bytes from the socket,…

HackX123
- 107
- 1
- 9
3
votes
3 answers
FD_ISSET always true even if there is no new data?
I am trying to check if a client has send some new data. This actually tells me that i always have new data:
bool ClientHandle::hasData()
{
fd_set temp;
FD_ZERO(&temp);
FD_SET(m_sock, &temp);
//setup the timeout to 1000ms
struct…

bemeyer
- 6,154
- 4
- 36
- 86
3
votes
1 answer
boost::asio::async_receive and 0 bytes in socket
Pseudo-code
boost::asio::streambuf my_buffer;
boost::asio::ip::tcp::socket my_socket;
auto read_handler = [this](const boost::system::error_code& ec, size_t bytes_transferred) {
// my logic
…

vladon
- 8,158
- 2
- 47
- 91
3
votes
1 answer
No data available to recv after select
Situation
I write a python client using nonblocking udp sockets. Sometimes I get
[Errno 11] Resource temporarily unavailable
As far as I know, this happens because I
Use nonblocking sockets
recv() on a nonblocking socket that has no data…

Steffen
- 31
- 3
3
votes
1 answer
Maximum data size that can be sent and received using sockets, at once?(TCP socket)
I am designing a game which has master and multiple players. They send and receive data using TCP sockets.
Players transfer character strings between themselves via TCP sockets.The programs are being executed in red hat linux 6 os .
The character…

Kai
- 953
- 6
- 16
- 37
3
votes
2 answers
C socket programming: calling recv() changes my socket file descriptor?
Hey all, I have this strange problem with recv(). I'm programming client/server where client send() a message (a structure to be exact) and server recv() it. I am also working with multiple sockets and select().
while(1)
{
readset =…

fourier
- 31
- 2
3
votes
2 answers
The behavior of send() and recv() in socket communication
The following is the setup:
Server Client
| |
accept connect
| |
v |
send msg1-> |
| |
v v
recv <- send
| |
v …

gc .
- 415
- 4
- 9
- 18
3
votes
4 answers
Nginx error recv() failed (104: Connection reset by peer)
Since a couple of days ago, I'm getting some errors on my server. I use CentOS 6.5 with Parallels 12.0.18, Apache server to serve dynamic content and Nginx as proxy to serve static content.
At first, I was getting the following error:
[error]…

Shupyrg
- 31
- 1
- 1
- 4
3
votes
1 answer
Socket with mysterious buffer
I am building a python based interface for pulling data over TCP from an instrument. The datastream comes as specific events, and the timing is not steady: I get bursts of data and then slow periods. They are small data packets, so for simplicity…

user2946891
- 33
- 3
3
votes
7 answers
Send Picture by socket (send func) in c++ , but do not recive complete(Windows)!
I am sending data from client to server,But picture do not receive complete.
Client Code:
FILE *fr = fopen(tmppicsend, "rb");
char* buffer;
buffer = (char*) malloc(sizeof(char)*size);
fread(buffer, size, 1, fr);
send_len_pic = send( m_socket_pic,…

M.Rezaei
- 992
- 3
- 11
- 28
3
votes
3 answers
How to detect that the client is still connected (and not hung-up) using recv()?
I have written a multiclient Server program in C on SuSE Linux Enterprise Server 12.3 (x86_64), I am using one thread per client to receive data.
My problem is:
I am using one terminal to run the server, and using several other terminals to telnet…

0xF1
- 6,046
- 2
- 27
- 50
3
votes
1 answer
Python: Receiving Data through Sockets - [Errno 11] Resource temporarily unavailable
Background
I need to communicate with a Tektronix MSO 4104 from python. The communication takes place over the LAN using the vxi11 ethernet protocol and python's socket library.
Situation
Now this works fairly well; I can cconnect to the scope and I…

Bacaa14
- 77
- 1
- 8