recv Questions
5
I have a main thread that waits for connection. It spawns client threads that will echo the response from the client (telnet in this case). But say that I want to close down all sockets and all thr...
Leenaleeper asked 26/5, 2010 at 17:4
2
Solved
I use file descriptors to find the readable sockets and go on to read. For some reasons, a socket that has no data on the wire, goes on to read and never returns. Is there a way I can come out of t...
4
Solved
C++ has the following function to receive bytes from socket, it can check for number of bytes available with the MSG_PEEK flag. With MSG_PEEK, the returned value of 'recv' is the number of bytes av...
7
Solved
I'm using the SocketServer module for a TCP server.
I'm experiencing some issue here with the recv() function, because the incoming packets always have a different size, so if I specify recv(1024) ...
Afflict asked 10/11, 2009 at 15:34
2
I want to write a client/server application, in which client and server can exchange messages.
Client site communication:
send
recv
send
recv
Server site communication:
recv
send
recv
send
How...
3
I have a very annoying problem that I found several times on other forums but I can't find a proper solution.
The problem is recv() returns 0 on the last few bytes of a connection. Here are some ba...
Abe asked 10/5, 2012 at 1:26
3
Solved
I have a client-server application.
The client is sending a string followed by an integer using two distinct send() calls. These two data are supposed to be stored into two different variables on...
3
Solved
I've implemented a web server in C. It calls recv() on a connected, blocking socket to receive an incoming HTTP request. The Linux man pages state the following about recv() on a blocking socket:
...
4
Let's say I start a thread to receive on a port. The socket call will block on recvfrom.
Then, somehow in another thread, I close the socket.
On Windows, this will unblock recvfrom and my thread e...
Poky asked 17/6, 2011 at 18:12
3
Solved
1
Solved
Let's say I'm using 1024 as buffer size for my client socket:
recv(1024)
Let's assume the message the server wants to send to me consists of 2024 bytes.
Only 1024 bytes can be received by my so...
3
Solved
I would like to obtain a behavior similar to this:
Server run
Client run
Client type a command like "help" or other
Server responds appropriately
go to 3
The problem is that when my function ex...
Grecian asked 20/11, 2012 at 18:29
3
Solved
5
Right now, I read one character at a time in a loop, until I reach the \0 character. Is there a better way to do this?
6
Solved
I have a few questions about the socket library in C. Here is a snippet of code I'll refer to in my questions.
char recv_buffer[3000];
recv(socket, recv_buffer, 3000, 0);
How do I decide how bi...
3
Solved
I am new to python and socket programming, and I'm confused about about usage for socket.recvfrom() and socket.recv(). I understand that people usually use recvfrom() for UDP and recv() for TCP.
Fo...
1
Solved
Basically I have been working on a simple chat room using socket and thread. In my client I can receive and send messages, my issue is that one comes before another in a loop, so if I am sending a ...
3
Solved
I read from socket using recv function. I have problem when no data available for reading. My programm just stops. I found that I can set timeout using select function. But looks that timeout affec...
Flagitious asked 22/5, 2015 at 11:14
2
Solved
I remember having read somewhere that a socket can be regarded as two independent half-duplex channels. Does it mean that recv() and send() of the same socket are actually irrelevant?
if so, is ...
Brier asked 22/7, 2010 at 11:24
2
Solved
Have some problems in receiving packets.
I can receive and read incoming packets, but I think i do not get a handshake with any host.
I only want to send a packet to a remote computer with an open ...
Casey asked 30/12, 2012 at 4:16
3
Solved
I am wondering how to shutdown JeroMQ properly, so far I know three methods that all have their pro and cons and I have no clue which one is the best.
The situation:
Thread A: owns context, shal...
2
Solved
I read in MSDN about the send() and recv() function, and there is one thing that I'm not sure I understand.
If I send a buffer of size 256 for example, and receive first 5 bytes, so the next time ...
Hasen asked 29/11, 2014 at 18:57
2
Solved
I have non blocking UDP socket in perl created this way
my $my_sock = IO::Socket::INET->new(LocalPort => $MY_PORT,
Proto => 'udp',
Blocking => '0') or die "socket: $@";
The recv ca...
3
Solved
I am very new in socket programming. I found that before sending messages we have to convert host byte order into network byte order. I have taken a look on many examples given on various sites but...
1
I was searching for hours to get an answer about my question, but didnt find anything. Maybe I get some help here.
What I'm trying to do:
A Java-Client sends a message to a C-Server. The message ...
1 Next >
© 2022 - 2024 — McMap. All rights reserved.