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
1
vote
2 answers

sendto() python

I use python program to do traffic generator in Linux Ubuntu, and the code like below: import socket, sys host = sys.argv[1] #Server IP Address textport = sys.argv[2] #Server Binding Port s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)…
waynner
  • 52
  • 8
1
vote
1 answer

UDP Talker gives "Bad value for ai_flags" on sendto() call

I am stuck with my UDP talker app. The goal for the moment is to initialize the server, register a client and then proceed to send something to that client. I've worked my way through Beej's network guide and coded the following library…
user1688482
  • 53
  • 2
  • 4
1
vote
2 answers

sendto() blocked when the buffer was full, how to solve it?

I wanna make a chat room for 4 guys in UDP. Here's the code: #include #include #include #include #include #define PORT 9999 #define SIZE 1024 int c; int i=0; int k=0; char…
socket
  • 1,153
  • 3
  • 13
  • 22
1
vote
1 answer

sendto returning EINVAL on Mac OS X 10.8

I had a program that worked properly with Mac OS 10.6 but inexplicably fails in 10.8. The gist of it is that sendto is now returning -1 and setting errno to EINVAL (22). What's going wrong?
insomniac2846
  • 442
  • 5
  • 8
1
vote
1 answer

script via windows sendto fails with more than 20 items

I've made a little script so I can select some files in Explorer (on Windows XP), right click, and Sendto. The script works fine for up to 20 files, but fails when 21 or more files are selected. Why & how can I fix this? :Loop If "%~dpn1"=="" Goto…
Mica
  • 18,501
  • 6
  • 46
  • 43
1
vote
0 answers

"Send to" a folder over to a batch script not behaving as expected

I have a simple batch script take.cmd echo %1 I've then created a shortcut to it in the C:\Users\abc\AppData\Roaming\Microsoft\Windows\SendTo folder. Specifically the shortcut and not the batch script itself so that I can run it as admin (right…
laggingreflex
  • 32,948
  • 35
  • 141
  • 196
1
vote
2 answers

How I can use windows's SendTo option in my C# Application using datagridview

i am listing files from directories on click on that specific folder name, when files show in datagridview. Now using context menu i want to add this sendto option in that context menu and want to send that file to any removable media.
Mujtaba
  • 85
  • 2
  • 10
1
vote
2 answers

android ndk sockets Network Unreachable

I don't know if this is in the way I'm handling Android, or a problem with my native code, or both. I am setting up a udp socket in C++ (wrappers generated by swig): udpSocket = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP); if (udpSocket < 0) …
eskimo9
  • 753
  • 10
  • 24
1
vote
2 answers

sendto() : Bad file descriptor in UDP - IPv6

static void app(const char *address, int port, char *name) { int sock; struct addrinfo server; sock = init_connection(address,port,&server); char buffer[BUF_SIZE]; write_server(sock, &server, name); /*error is here*/ /* ..... */ …
user1361431
  • 11
  • 1
  • 3
0
votes
1 answer

recvcfrom() and sendto() ip address to be used

Actually, I want to create an application in C such that 2 people can chat with each other. Let us assume they know their IP (Actually, I think I am making the mistake here. I get my IPs from www.whatismyip.com). void recv_data(char *from, unsigned…
user1151738
0
votes
0 answers

UDP sendto() function occasionally takes too long

I’m using UDP function sendto(), According to the UDP protocol, the function should send/discard the datagram and then return immediately, However, in my test, I found that in a LAN, when I sending a large number of data patckets(200M) continuously,…
Drake Wu
  • 6,927
  • 1
  • 7
  • 30
0
votes
0 answers

sendto ipv6 multicast ping from python causes EADDRNOTAVAIL (Cannot assign requested address)

I have an interface that is in link up. If I try the following code (that sends out an IPv6 multicast ICMP packet), I get EADDRNOTAVAIL after a few times. To fix the problem I give a ifconfig down/up to the interface but after a few times I get…
0
votes
0 answers

Undertstanding UDP broadcast sending and receiving in C (system functions)

I'm trying to learn how sockets and networks work. For example in C in Linux. I have two simple programs. Both take ip and port as parameters. The first program is a server that broadcasts a message every second. int main(int argc, char** argv){ …
0
votes
1 answer

Signal interrupt sendto/recvfrom on datagram socket

What happens if signal interrupts sendto or recvfrom call on datagram socket? Can I expect that these calls always return -1 with errno == EINTR or they can return positive number of bytes, but I shall repeat the call entirely?
0
votes
0 answers

sendto() for UDP server is not sending data to client

I'm lost, but the title sums it up. I'm trying to make a UDP server using netster, but for whatever reason, I'll get data from the client but not the other way around. I suspect it has something to do with clientaddr due to getting an error "sendto:…