Questions tagged [recv]

BSD Sockets function used for receiving data from a TCP socket.

670 questions
-1
votes
1 answer

Why loop while the buffer is smaller than the message when using recv?

I am reverse engineering some assembly for a server binary, and am having some trouble understanding some code around a recv call. I derived the following pseudo-code from the assembly, and the while loop condition confuses me: func_804a890(int…
justin
  • 53
  • 8
-1
votes
1 answer

C Sockets - send() sends, recv() not receiving

So I'm doing some client server stuff here, and I want my server to listen for clients, and when a client connects to the server, the client sends a string. The connection establishes, the clients sends it's string, but, at server side, recv()…
-1
votes
1 answer

python socket- send() command doesnt work

i need to write a server and a cliet which do 4 things 1.send the time the message was recived 2.get all the files in a folder 3.copy a file from that folder and create a new file(txt) in another folder 4. close the progrem clint: import socket …
-1
votes
1 answer

Modify buffer data of recv

Im making an application to manipulate send and recv, doing it with send was very easy but I can't figure how to fake or replace the recv. What I'm trying to do is for example, if the program receives "Hello", filter it and make the program believe…
32bitsx86
  • 21
  • 5
-1
votes
1 answer

How can I stop C++ recv() when string read is finished?

I am reading an Image URL sent from a Java client to a C++ server from Sockets. The server stops reading through recv() when it detects there is a null character in the char buffer[] as I do below in the following code: void *…
hectorhfm
  • 105
  • 9
-1
votes
1 answer

recv return after 0x0000 byte found

Here is my code: Client Position pos(1.0,2.0,0.45); feedback feed(12, pos, 100); msgpack::sbuffer sbuf; msgpack::pack(sbuf, feed); int test = write(tcp_client.sockfd, sbuf.data(),sizeof(sbuf)); Server : char* buffer = new char[41]; int…
Vtik
  • 3,073
  • 2
  • 23
  • 38
-1
votes
2 answers

python recv() and eval()

can someone please help me understand this code clientsock.send("Welcome to Maths_Server 1.0\n") try: clientsock.send("Enter the first number, so I can EVALuate it:\n") firstNum = eval(clientsock.recv(1024)) firstNum = firstNum +…
AdoobII
  • 249
  • 3
  • 11
-1
votes
1 answer

TCP does not receive sent data

I've been testing a TCP client/listener. My test opens 10 clients and accept them properly. Then it send some data through each of them. Only after correctly send all data it tries to receive it in the opposite side. Here you can see the output from…
edupo
  • 99
  • 1
  • 7
-1
votes
1 answer

how to end reciving data

How to end reciving data from client ? I Wrote this code that listen on port 80 I want to get request from client browser and send response C++ : while ( (l = recv(client, buff, 250, 0)) > 0){ buff[l] = '\0'; printf(buff); …
HERO
  • 33
  • 1
  • 5
-1
votes
3 answers

Socket in python and socket.recv()

I am sending some request from the server to my client but I have some problem. When I'm sending messages to the client, if I send many messages, I'll receive all with socket.recv() Is there a way to get the messages one by one ? Thanks
AnonBird
  • 570
  • 13
  • 27
-1
votes
1 answer

Recv always receive 1 less byte

I'm really tired with this - I tried to fix it for about 5 hours and I still can't semm to find a problem, maybe You guys can. My problem is that recv at the client side always recv one less byte when I'm sending IP from server. And server is always…
darekg11
  • 175
  • 1
  • 3
  • 13
-1
votes
1 answer

send and recv back and forth

I'm trying to implement a very simple tcp server/client which should do this: S:listens on port C:connects S:send "hello, type the password" C:gets message, sends password S:answers "right" or "wrong" in case of right/wrong password from the client.…
jjstcool
  • 165
  • 2
  • 9
-1
votes
1 answer

c server code printf

while ((c = accept()> 0){ // Do whatever a web server does. printf("got connected\n"); recv_buf[i]='\0'; printf("%s\n" , recv_buf); printf("input received"); } this while loop receives the message and prints the…
-1
votes
1 answer

Using same socket for second send and recv giving no result?

when I want to use the same socket connected to the host to send() and recv() for the second time, recv() will return 0 without anything in buffer basically Im doing: connect to the website send packets receive packets send packets again (I think…
SEnergy
  • 47
  • 1
  • 11
-1
votes
1 answer

select watches socket fd wakes up too slow

I'm having a latency issue with select(). Actually I'm not sure if this is a problem with select() or not. Story is like below. I'm using select() to detect a socket fd event. After select() wakes up, I do recv() to get data stream from a socket…
1 2 3
44
45