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
60
votes
7 answers

Passing a structure through Sockets in C

I am trying to pass whole structure from client to server or vice-versa. Let us assume my structure as follows struct temp { int a; char b; } I am using sendto and sending the address of the structure variable and receiving it on the other side…
codingfreak
  • 4,467
  • 11
  • 48
  • 60
25
votes
3 answers

unix socket error 14: EFAULT (bad address)

I have a very simple question, but I have not managed to find any answers to it all weekend. I am using the sendto() function and it is returning error code 14: EFAULT. The man pages describe it as: "An invalid user space address was specified for…
aktungmak
  • 409
  • 1
  • 5
  • 13
11
votes
3 answers

Sending ICMP packets in a C program

I'm trying to create an ICMP ping test program in C but am having difficulties with successfully sending the packets. The sendto function returns the # of bytes and everything but no packets are actually sent. I've verified this with WireShark on…
Zac
  • 2,325
  • 3
  • 23
  • 33
9
votes
3 answers

How to implement a "send to kindle" link?

I'm trying to find out how to create a link that will send the current page/article on my site to a users Kindle device. I haven't been able to find much about it, but I know it can be done because I see it here:…
android.nick
  • 11,069
  • 23
  • 77
  • 112
8
votes
1 answer

.sendto() method on sikuli python script does not work on windows

I developed a sikuli python script on windows that uses this code: from socket import AF_INET, SOCK_DGRAM import sys import socket import struct, time host = "pool.ntp.org" port = 123 buf = 1024 address = (host,port) msg = '\x1b' + 47 * '\0' #…
user3472065
  • 1,259
  • 4
  • 16
  • 32
8
votes
6 answers

Sending email with attachment using SENDTO on some devices doesn't work

At first you're going to think "Wait, this question is a duplicate!". Read on. I'm trying to use the Intent ACTION_SENDTO (with an Email URI as data) in order to have just email apps respond. (Using ACTION_SEND launches a standard "SEND" chooser…
Graeme
  • 25,714
  • 24
  • 124
  • 186
6
votes
1 answer

Python 3 - verify sendto() Success

I have 2 UDP responses to a destination ip, one right after the other: sendsock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM, socket.IPPROTO_UDP) sendsock.bind(('%s' % ip_adr, 1036)) #send first packet ok_response = "Reception Success, more to…
coffeemonitor
  • 12,780
  • 34
  • 99
  • 149
6
votes
4 answers

ACTION_SENDTO does not work

I want to send out an email from my app. So I used the following code. String uriText = "abcd@gmail.com" + "?subject=" + URLEncoder.encode("Subject") + "&body=" + URLEncoder.encode("some text here"); Uri uri = Uri.parse(uriText); Intent sendIntent =…
Karthik Andhamil
  • 848
  • 1
  • 13
  • 22
5
votes
2 answers

sendto : Resource temporarily unavailable (errno 11)

I am having a problem with sendto. I have a receiver who receives UPD packets with recvfrom and then replies to the sender using sendto. Unfortunately, I am getting errno 11 (Resource temporarily unavailable). I am using two sockets. The first…
Jary
  • 53
  • 1
  • 1
  • 4
5
votes
3 answers

Socket programming: sendto always fails with errno 22 (EINVAL)

I am always getting no bytes sent, with an errno of 22 (EINVAL, Invalid Argument) with this code. The destination_host is set elsewhere and known to be valid, so I really don't see what is going on. MAXMSGSIZE is 1000. No errors, or warnings. I…
dc.
  • 1,429
  • 2
  • 17
  • 29
5
votes
6 answers

UDP Response

UDP doesnot sends any ack back, but will it send any response? I have set up client server UDP program. If I give client to send data to non existent server then will client receive any response? My assumption is as; Client -->Broadcast server…
anand
  • 11,071
  • 28
  • 101
  • 159
5
votes
2 answers

How to send modified IPv6 packet through RAW socket?

I'm trying to send a custom IPv6 header through a RAW socket in C Linux. I already succeded in IPv4 using the IP_HDRINCL socket option, however, there's not an equivalent for IPv6. I found a workaround here suggesting to use socket(AF_INET6,…
Pepedou
  • 787
  • 1
  • 13
  • 35
4
votes
2 answers

Faster WinSock sendto()

I'm using Windows Server 2008, and my program is in C++. I'm using WinSock2 and sendto() in a while(true) loop to send my packets. Code like so: while(true) { if(c == snd->max) c = snd->min; dest.sin_addr.S_un.S_addr = hosts[c]; …
seth
  • 139
  • 3
  • 8
4
votes
2 answers

Linux multicast sendto() performance degrades with local listeners

We have a "publisher" application that sends out data using multicast. The application is extremely performance sensitive (we are optimizing at the microsecond level). Applications that listen to this published data can be (and often are) on the…
Matt
  • 952
  • 2
  • 8
  • 17
4
votes
3 answers

UDP socket sendto() functions

I get an error if I want to write on my udp socket like this. According to the docu there shouldn't be a problem. I don't understand why bind() works well in the same way but sendto() fails. udp_port = 14550 udp_server =…
dgrat
  • 2,214
  • 4
  • 24
  • 46
1
2 3
14 15