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

Sendto function return error - UDP socket on windows

I have problem with sendto function. I want to get time from UDP server. My code like this: unsigned char msg[48]={010,0,0,0,0,0,0,0,0}; char* hostname=(char *)"tick.usno.navy.mil"; sockaddr_in server_addr; WSAData data; int result=WSAStartup(…
Nejc Galof
  • 2,538
  • 3
  • 31
  • 70
0
votes
1 answer

Coding UDP Socket in C - sendto Invalid Arguments

I'm actually back to programming in C, and I want to code a UDP Client. My problem is that I'm having an error when executing the sendto function... getting errno : 22 and the message error : Invalid argument char query[1024]; int querySize =…
McH
  • 9
  • 2
0
votes
1 answer

windows winsock2 socket return 10014 WSAEFAULT from WSAGetLastError (ipv4 / ipv6 related)

Steps to reproduce: Create IPv6 socket AF_INET6/SOCK_DGRAM/UDP Bind the socket to an IPv6 address Use sendto(...) winsocket API but specify an IPv4 socket AF_INET family address address to send to Winsock2 API will return WSAEFAULT with…
Robin R
  • 1,037
  • 10
  • 6
0
votes
0 answers

Android intent send email: Showing duplicate values in the Email TO field

I am trying to send email programmatically. I am taking the input from a editText box and putting them into an array so they can be displayed in the TO field. But, it shows duplicate values and I have to click on one of them to make it a valid email…
A KA
  • 75
  • 1
  • 5
0
votes
1 answer

Client failing to send request to server with udp connection

I am using winsock and c++ to program a client and server to return the offset from the NTP time and box time. My problem when I debug is that the client is failing to send the request to the server. The specific function that fails is my…
ecain
  • 1,282
  • 5
  • 23
  • 54
0
votes
1 answer

Python: Creating 16-bit source and destination ports for a packet header

I'm creating a networking protocol in application space on top of UDP in python for homework. I need to represent the source port and destination port as 16-bit numbers. All attempts have failed. The way I'm testing this is by creating a udp socket…
toshiomagic
  • 1,335
  • 1
  • 12
  • 39
0
votes
1 answer

Segmentation Fault in UDP

I got a segmentation fault problem when I write a client-server project in UDP. It happens on server side, when I receive a packet from client and going to send an ACK back. I tried to search the solutions and got UDP Server giving Segmentation…
EricBkc
  • 369
  • 2
  • 4
  • 12
0
votes
1 answer

what wrong with "<>" missing

I wrote a program to send syslog to remote sever.Part of my code is below: sprintf(syslogBuf,"<%d>LogTime=\"%s\";user=\"%s\";IP=\"%s\";Sip=\"%s\";OpType=\"%s\";OpResult=\"%d\";OpText=\"%s %s\"", …
EK.CR
  • 15
  • 5
0
votes
1 answer

UDP Sockets in C - Sendto() Send failed : invalid arguments

I am trying to implement UDP sockets in C in a very simple/basic fashion. My programs are meant to send/receive files between terminals with one program running on each. I am having a problem with the sendto() function in my client code. Here is my…
bibzuda7
  • 64
  • 3
  • 10
0
votes
0 answers

Send UDP packets through no IP assigned bridge interface in Ubuntu Linux

I have two network interfaces (e.g. eth0 and eth1) configured as two ends of a bridge in Ubuntu Linux 14.04. They are not assigned with any IP addresses. eth0 is physically connected to a subnet. I want to send UDP packets through eth0 to a subnet…
user1133555
  • 103
  • 8
0
votes
2 answers

C sendto returns -1 if broadcasting on a vpn

I have built a udp server that broadcasts a message every so often. It broadcasts without a problem. But if I turn on my vpn, then sendto will start returning -1 even though I am sending to INADDR_BROADCAST. I am running this on a mac btw if that…
Samuel
  • 1
0
votes
0 answers

Sendto not working Windows-Form Application

I am working on socket programming(UDP sockets) in Windows-form application. I have called socket() on button click then I want send some bytes on other button click.Sendto() is returning 0 when I click the desired button but data is not received on…
Saad Rafey
  • 531
  • 2
  • 6
  • 18
0
votes
2 answers

TCP sendto (C++) fails on Linux but not OSX. Errno: EINVAL 22 Invalid argument

On the client side of my application, the following runs fine on OSX. But when compiled/run on Linux (Ubuntu 12 or Raspbian) sendto() always fails with a EINVAL/22/invalid argument. How do I run it on Linux? std::vector rawVect; //…
cloudsurfin
  • 2,467
  • 2
  • 25
  • 29
0
votes
2 answers

SendTo menu and single instance program

I'm making a program through which I will be able to send files to an FTP server just by right clicking "SendTo". The problem is that every time I click "SendTo" it opens a new exe file and it works as a separate program. I need to make it somehow…
Semas
  • 869
  • 10
  • 22
0
votes
1 answer

sendto is not giving error on sending

Hi I have following code: if ((fd = socket(PF_INET, SOCK_DGRAM, 0)) < 0) { perror("socket(UDP): "); return 0; } family = AF_INET; if((remote_server_ent = gethostbyname2(hptr, family)) == NULL ) { perror("gethostbyname2"); return…
Achint
  • 3
  • 3