By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,227 Members | 1,376 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,227 IT Pros & Developers. It's quick & easy.

help with sendto (linux)

P: n/a
I've been having trouble with sendto function (I open a socket, bind it to
eth0, recvfrom works fine but when I execute following line I get sendto():
invalid argument)

if(sendto(sokit, buf, sizeof(buf), 0, (struct sockaddr *)&drugaadr,
sizeof(drugaadr))==-1){
perror("sendto()")
exit(-1)
}

sokit is int variable with socket handler (value 3)
buf is declared char[60]
drugaadr is struct sockaddr_in

drugaadr.sin_family=AF_INET;
drugaadr.sin_port=0;
drugaadr.sin_addr.s_addr=inet_addr("192.168.0.1");
and the drugaadr.sin_zero is filled with 8 zeros.

Please help (I'm trying to send an ARP packet, but that's within buf, and it
shouldn't have anything to do with sendto failure), I've searched the
internet but came empty-handed.

Thanks,

Vedran
Nov 14 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
B.r.K.o.N.j.A. <th********@inet.hr> spoke thus:
I've been having trouble with sendto function
(etc.)


Then you want to ask your question on comp.unix.programmer. Only
ANSI/ISO C, which does not include sendto() or any other network
functions, is discussed here.

--
Christopher Benson-Manica | I *should* know what I'm talking about - if I
ataru(at)cyberspace.org | don't, I need to know. Flames welcome.
Nov 14 '05 #2

P: n/a
"B.r.K.o.N.j.A." wrote:

I've been having trouble with sendto function (I open a socket, bind it to
eth0, recvfrom works fine but when I execute following line I get sendto():
invalid argument)

This is not a standard C function. You need to find a newsgroups where
it is on-topic. There are a number of Linux groups, one is surely right.
If it's a POSIX function (I'm not sure) then comp.unix.programmer might
be suitable.


Brian Rodenborn
Nov 14 '05 #3

P: n/a
On Thu, 11 Dec 2003 23:05:26 +0100, in comp.lang.c , "B.r.K.o.N.j.A."
<th********@inet.hr> wrote:
I've been having trouble with sendto function (I open a socket, bind it to
eth0, recvfrom works fine but when I execute following line I get sendto():
invalid argument)


Wrong door. You want comp.unix.programming or somesuch, sockets and
networking are offtopic here, but topical there.

--
Mark McIntyre
CLC FAQ <http://www.eskimo.com/~scs/C-faq/top.html>
CLC readme: <http://www.angelfire.com/ms3/bchambless0/welcome_to_clc.html>
----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeed.com The #1 Newsgroup Service in the World! >100,000 Newsgroups
---= 19 East/West-Coast Specialized Servers - Total Privacy via Encryption =---
Nov 14 '05 #4

P: n/a
Thanks, that's what I'll do.

Vedran

"Christopher Benson-Manica" <at***@nospam.cyberspace.org> wrote in message
news:br**********@chessie.cirr.com...
B.r.K.o.N.j.A. <th********@inet.hr> spoke thus:
I've been having trouble with sendto function
(etc.)


Then you want to ask your question on comp.unix.programmer. Only
ANSI/ISO C, which does not include sendto() or any other network
functions, is discussed here.

--
Christopher Benson-Manica | I *should* know what I'm talking about - if I
ataru(at)cyberspace.org | don't, I need to know. Flames welcome.

Nov 14 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.