Questions tagged [sendto]

sendto() is a system call used to transmit a message to another socket.

sendto() is a system call used to transmit a message to another socket. It is used on a connection-mode socket.

Reference:

217 questions
3
votes
2 answers

Help with Sending/ Receiving UDP packets - C Sockets

Ok, if you look at some of my previous questions, I've been working on getting a simple connection up and running with C sockets (I'm still fairly new to the whole networking aspect of an program, but everyone has to start somewhere, right?). I've…
Josh Bradley
  • 4,630
  • 13
  • 54
  • 79
3
votes
2 answers

Invalid argument in sendto when using interface name to set IP_MULTICAST_IF

I am writing a small program that sends and receive multicast packets.I need to set the outgoing interface with its name (e.g. eth0) rather than its address. Therefore I have to use struct ip_mreqn (rather than struct in_addr) so that I could use…
Jahanzeb Farooq
  • 1,948
  • 4
  • 27
  • 27
2
votes
2 answers

Explore.exe Address Bar "Shell:" Command in Windows 7

With Windows 7 was just trying to navigate to c:\users\scott.cate\sendto to modify the [send to] context menu and I was getting access denied. With a little search engine work I found this trick. Open Windows Explorer (Win+E Shortcut) and…
ScottCate
  • 2,365
  • 7
  • 21
  • 35
2
votes
0 answers

file transfer using stop and wait protocol and udp protocol in C

I want to send a file using UDP with stop and wait protocol. I have a client and server code that is working fine with a single input string. I was trying to change the code for file transfer but no success. Can anyone help me with minimal changes…
2
votes
2 answers

sendto creating a segmentation fault when sending a packet

I'm trying to send a packet through UDP, however I'm getting a seg fault on line 198: sendto(socketfd, buffer_str, total_len, 0, res->ai_addr, res->ai_addrlen); And I'm not quite sure what is causing it. I've run the program through GDB, and none…
2
votes
0 answers

In a VXLAN overlay network, when does sendto() complete/return?

The overlay packets have to traverse a complex path in the kernel (involving multiple network stacks) before going out to the wire. When I trace the main kernel functions involved (using eBPF), the path of a packet looks something like…
munikarmanish
  • 352
  • 2
  • 3
  • 13
2
votes
1 answer

UDP server fails to send reply back and sendto returns -1 and errno is 22

I am having this problem with UDP client/server code. This code was copied from https://www.geeksforgeeks.org/udp-server-client-implementation-c/ and modified minimally to fix compilation errors and print errno in the server code. // Client side…
feeling_lonely
  • 6,665
  • 4
  • 27
  • 53
2
votes
1 answer

C Socket sendto Invalid argument error

My router.c file creates 2 sockets the first is to bind to a port and answer clients the second is to connect to an already bound port (by the server.c file) and send messages to. for some reason the sendto line return an Invalid argument…
foxy_86
  • 21
  • 2
2
votes
0 answers

can a message just disappear between the call to sendto() and the sending network card without notifying the caller?

I send a datagram (6740 bytes) with sendto() to another host on the same LAN. Often there is no problem, and the other host got the datagram. But sometimes the datagram disapears, it never reach the local network interface, I have seen this with…
lgwest
  • 1,347
  • 5
  • 16
  • 26
2
votes
1 answer

Periodic latency spikes from UDP socket caused by periodic sendto()/recvfrom() delay, C++ for Linux RT-PREEMPT system

I have setup two Raspberry Pis to use UDP sockets, one as the client and one as the server. The kernel has been patched with RT-PREEMPT (4.9.43-rt30+). The client acts as an echo to the server to allow for the calculation of Round-Trip Latency…
Rory
  • 51
  • 1
  • 5
2
votes
1 answer

ECONNREFUSED errors on UDP sendto

I am experiencing some unexplained behavior with an app that is writing UDP data with sendto() to multiple ports (all opened with socket(PF_INET, SOCK_DGRAM, 0)) for the benefit of a set of client reading processes. These sendto()s occasionally and…
Roger Davis
  • 41
  • 1
  • 2
2
votes
1 answer

UDP server/client in C - sendto error: Address family not supported by protocol

I am writing a simple illustrative UDP server client. Server should, based on the client input calculate client's network byte order, and send it back to client. I've been trying to fix this error for whole day now. Any help would be apprecciated.…
mi105
  • 149
  • 1
  • 9
2
votes
3 answers

How to Send a structure using sendto()

I have created structure : struct buffer { string ProjectName ; string ProjectID ; } buffer buf; buf.ProjectID = "212"; buf.ProjectName = "MyProj"; Now to send this structure using sendto method , I am typecasting the strucure and sending…
Simsons
  • 12,295
  • 42
  • 153
  • 269
2
votes
1 answer

In Java, How can I read file name from the context menu in Windows

I'm new here and in Java programing I'm trying to write program that cath the context menu command and read the file name and his full path for example when I'm clicking (right mouse) on some file and getting the context menu and I selecting any…
SimonB26
2
votes
2 answers

When will one socket suffice, when do I need to create more?

The "connectionless" aspect of UDP has thrown me for a loop... If I setup a UDP socket set to INADDR_ANY, then bind that to port 33445 on the local machine, the machine will accept incoming connections from various clients. All of these connections…
bitcruncher
  • 800
  • 1
  • 7
  • 14
1 2
3
14 15