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...
Enfranchise asked 20/7, 2011 at 0:15

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...
Yoghurt asked 20/10, 2012 at 2:48

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...
Undertow asked 19/6, 2020 at 16:49

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...
Internist asked 2/7, 2014 at 16:32

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: ...
Betthel asked 24/6, 2016 at 20:32

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

I have a question for you. I have this class: ` #define DIMBLOCK 128 #ifndef _BLOCCO_ #define _BLOCCO_ class blocco { public: int ID; char* data; blocco(int id); }; #endif blocco::bl...
Preterhuman asked 29/8, 2013 at 16:59

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...
Healthful asked 29/12, 2016 at 14:58

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

I have a server-client application that I'm working on that basically simulates a chat room. This is an assignment for school and the protocol specifications are somewhat strict. I have a char ar...
Punkie asked 13/11, 2016 at 23:19

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?
Miller asked 18/7, 2010 at 9:8

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...
Dyadic asked 19/5, 2010 at 0:19

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...
Chacon asked 20/3, 2016 at 15:53

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 ...
Lastditch asked 30/10, 2015 at 10:39

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...
Driftwood asked 27/3, 2014 at 11:46

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...
Talie asked 14/5, 2012 at 8:1

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...
Awe asked 16/4, 2014 at 10:33

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 ...
Mohamed asked 22/11, 2013 at 16:17

© 2022 - 2024 — McMap. All rights reserved.