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
0
votes
1 answer

UDP message size difference

Say that A sends B a UDP message of size N like sockaddr_in to; to.sin_family=AF_INET; to.sin_port=htons(port); to.sin_addr.s_addr=inet_addr(address); sendto(sock,(const char*)buffer,N,0,(sockaddr*)&to,sizeof(to)); Now B receives this message…
user877329
  • 6,717
  • 8
  • 46
  • 88
0
votes
1 answer

Sending struct over UDP c

I'm having trouble sending a struct via UDP. I am a newbie to networking as well as C but need to send data as a struct (not serialized). I am getting a segmentation fault when I attempt to send. Please excuse any newbie mistakes. Any help would…
Mike D
  • 41
  • 1
  • 3
  • 7
0
votes
1 answer

Do we need to bind when using raw socket?

I am using raw socket to pump specific IP Packets to network. I construct the total IP Packet and send using sendto. My question is, what is the need to bind the socket to an IP address, when I am using a raw socket.(Since the source address is…
0
votes
0 answers

c++ udp 10038 socket error on sendto()

I'm getting a 10038 socket error on a sendto() call. What could be causing this? I'm not getting any errors upon socket creation or binding. Here's how I set up my socket: Client client; client.client_socket = client.open_port(PEER_PORT2);…
stevetronix
  • 1,231
  • 2
  • 16
  • 32
0
votes
1 answer

sendto: Invalid argument

I'm trying to get a program (client) to communicate with another (server) using sockets in C, but I'm constantly getting the error "Invalid Argument" from the server. I'll try to show the pieces of code that are relevant to this issue after…
Elijah
  • 15
  • 1
  • 1
  • 3
0
votes
1 answer

'sendto()' function won't send data to an application on another computer

i wrote a client application in c using the posix sockets api on linux that sends information to a server, which then gets printed to the servers terminal window. If the server is on the same machine as the client and the client sends to the…
gurbos
  • 1
0
votes
1 answer

sendto() packet dropped by kernel

ioctl(socketFd_, SIOCOUTQ, &outstandingBytes); getsockopt(socketFd_, SOL_SOCKET, SO_SNDBUF, &sendBuffSize, &buffLen); I am using these two api to debug the packet drop in my program. observation: sendto will always return the packet size so…
devesh
  • 76
  • 9
0
votes
1 answer

C++: Classic communication exercise between server and client

Good day. As a computer science student, learning low-level C programming, i'm stucked in the "classic" practice exercise of writting a server-client communicating program. The goal is to develop a server component which receives a command from a…
JAguirre
  • 45
  • 8
0
votes
2 answers

How to know send() or sendmsg() successfully deliver message?

I set up a simple client and server program using TCP socket to communicate. The server waits for the client to connect and reply whether it receives the message from the client. Below is how the code is implemented in the server and the…
Hieu Nguyen
  • 382
  • 2
  • 15
0
votes
1 answer

Get the file path from Send to option WPF

I want to implement a wpf application that will listen to an event that comes from the desktop from the Send To shortcut. Such as right click on the file and select send to app, then get the file path. How would that be developed?
galbru
  • 422
  • 1
  • 5
  • 15
0
votes
1 answer

Different performance between sendto and recvfrom

I have noticed that there is a difference of performance between sendto and recvfrom (UDP). I send about 100Kbytes from a server to a client, using WiFi (the estimated bandwidth is about 30Mb/s in both directions), and the sending time is about 4-5…
0
votes
2 answers

C windows sendto()

I am trying to send over UDP using the following code, but i'm getting strange results. if((sendto(newSocket, sendBuf, totalLength, 0, (SOCKADDR *)&sendAddr, sizeof(sendAddr)) == bytesSent) < 0) { printf("Send error! - %d\n",…
Alistair
  • 23
  • 1
  • 4
0
votes
2 answers

Broadcast sendto failed

I am trying to broadcast data but the output is udp send failed. I chose a random port 33333. What's wrong with my code? int main() { struct sockaddr_in udpaddr = { sin_family : AF_INET }; int xudpsock_fd,sock,len = 0,ret = 0,optVal = 0; …
Brknl
  • 97
  • 3
  • 9
0
votes
2 answers

sys_sendto Linux systemcall implementation

I am trying to explore the implementation of the "sendto" socket function. I tried to find an implementation in Linux. In Linux, sendto function corresponds to "sys_sendto" system call. When I tried to follow it, I only found one definition for it…
user2410592
  • 183
  • 1
  • 3
  • 8
0
votes
1 answer

Windows SendTo from script

I'm writing an application where I have to send an email with an attachment using the default mail application. Before the email is sent, I want the user to be able to edit the text, i.e. the application should just open the mail client with…
Remo.D
  • 16,122
  • 6
  • 43
  • 74