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
3 answers

why the sendto function needs the third parameter, in socket programming

I was new to socket program. When learning the sendto function, as the prototype: ssize_t sendto(int socket, const void *message, size_t length, int flags, const struct sockaddr *dest_addr, socklen_t dest_len); I…
Akr
  • 179
  • 2
  • 4
  • 13
0
votes
1 answer

strange udp socket sendto behaviour

I'm trying to send a data using UDP socket and capture the data using a wireshark (under Windows7): client_sockd= socket(AF_INET,SOCK_DGRAM,IPPROTO_IP); client_address.sin_family = AF_INET; client_address.sin_addr.s_addr =…
qmor
  • 568
  • 6
  • 20
0
votes
1 answer

How to send bytes using python (example please!)

I'm trying to create a simple thingermajigger in python at the moment just to test out sending UDP packets over a socket. I think that I'm getting my script perfectly fine other than using the socket.sendto command. I keep getting errors regarding…
0
votes
2 answers

Using Getaddrinfo() and SendTo() on Socket UDP fails - Segmentation fault (core dumped)

After I start using getaddrinfo() to retrieve dynamic IP addresses, the sendTo() of my socket no longer works and returns error "Segmentation fault (core dumped)". Why is that happening, is there any initialization or memory allocation missing in my…
user2212304
  • 13
  • 1
  • 5
0
votes
1 answer

UDP client/server block

This is the client: int main(int argc, char* argv[]){ int port; int nrb; int flag; int file; struct hostent *host; unsigned int len; char fileName[50]; int sock; char* buffer; int bytesRead; char…
Ady Moldo
  • 55
  • 1
  • 10
0
votes
1 answer

Is there a technique to determine if a dos app was invoked via sentto vs a dos window?

In the case of a sendto invocation, I would like to keep the application open, after it completes, so the user can look at it. In the case of a dos window invocation, the user controls when the window closes. The platform is XP using msvc 6
EvilTeach
  • 28,120
  • 21
  • 85
  • 141
0
votes
1 answer

android.content.Intent.ACTION_SENDTO default email chooser

How can I send a e-mail in android app without chooser? I want that user set a default email client once and the app just use this email client until the user change your settings! the idea is press button send in my app and the msg will send it…
0
votes
2 answers

Sendto() still return me 0 bytes sent

Some days ago i wrote a post about an error returned from sendto() . It returned me 0 bytes written tough i pass a non-null value as length. void caught_packet(u_char *user_args,const struct pcap_pkthdr *cap_header,const u_char *packet){ int…
REmaxer
  • 1
  • 3
0
votes
1 answer

Why udp sendto become so slow when the input data size increase a little?

I have a strange question. I did the following test on android: i=0; while(i< PACKET_NUMBER) { //UDP send packets if( sendto(sockfd,buffer,strlen(buffer),0, (struct sockaddr *)&serv_addr, sizeof(serv_addr)) <= 0) { error("failed to…
0
votes
1 answer

Why are the buffers in VxWorks sendto() and send() functions of different types, and how do I handle them in the same manner?

In VxWorks, sendto() is defined as: int sendto ( int s, /* socket to send data to */ caddr_t buf, /* pointer to data buffer */ int bufLen, /* length of buffer */ int flags, /*…
Littlegator
  • 385
  • 4
  • 18
0
votes
2 answers

sendto pid and groups

I'm trying to understand this line from an strace on linux: sendto(10, "\24\0\0\0\26\0\1\3\233\274\362O\0\0\0\0\0\0\0\0", 20, 0, {sa_family=AF_NETLINK, pid=0, groups=00000000}, 12) = 20 I have looked on the net and in man pages about sendto, but I…
user300811
  • 158
  • 1
  • 6
0
votes
1 answer

send: invalid argument

I have a problem with this line of code. I must take a packet to a port and resend to interface(ex:eth0). My program successfully take packet from the port but when I resend (with send()) to interface I have an error: send:Invalid argument The line…
user1307697
  • 15
  • 1
  • 10
0
votes
1 answer

cocoaAsync:udp sendto success but Wireshark can't capture out data

I'm using cocoaAsync to handle udp communication. When i use the sendData API of cocoaAsync ,I'm sure sendto is success,from the log. But I can't see any output data from Wireshark . This is not 100% reproducible, but very probably. I can't figure…
sinopec
  • 851
  • 1
  • 9
  • 16
0
votes
1 answer

sendto() - UDP unicast in C

I have the function below that sends the message to the next_hop (e.g. 192.168.0.10) as UDP unicast. When I compile the code I get the following warning passing argument 2 of 'sendto' makes pointer from integer without a cast for the line…
johan
  • 1,943
  • 10
  • 31
  • 43
0
votes
1 answer

recvfrom() returns sender port as 0 (zero)

I have a simple UDP Server and Client. Client creates a DGRAM socket, binds it (explicitly) (even through it is not required), prints out the port it got bound to using getsockname() (non-zero) and then sends a message (via sendto()) which is…
Muhammad Waqar
  • 849
  • 2
  • 13
  • 29
1 2 3
14
15