Connecting Tech Pros Worldwide Forums | Help | Site Map

help with sendto (linux)

B.r.K.o.N.j.A.
Guest
 
Posts: n/a
#1: Nov 14 '05
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



Christopher Benson-Manica
Guest
 
Posts: n/a
#2: Nov 14 '05

re: help with sendto (linux)


B.r.K.o.N.j.A. <thebrkonja@inet.hr> spoke thus:
[color=blue]
> I've been having trouble with sendto function
> (etc.)[/color]

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.
Default User
Guest
 
Posts: n/a
#3: Nov 14 '05

re: help with sendto (linux)


"B.r.K.o.N.j.A." wrote:[color=blue]
>
> 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)[/color]


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
Mark McIntyre
Guest
 
Posts: n/a
#4: Nov 14 '05

re: help with sendto (linux)


On Thu, 11 Dec 2003 23:05:26 +0100, in comp.lang.c , "B.r.K.o.N.j.A."
<thebrkonja@inet.hr> wrote:
[color=blue]
>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)[/color]

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 =---
B.r.K.o.N.j.A.
Guest
 
Posts: n/a
#5: Nov 14 '05

re: help with sendto (linux)


Thanks, that's what I'll do.

Vedran

"Christopher Benson-Manica" <ataru@nospam.cyberspace.org> wrote in message
news:braq7p$j3r$1@chessie.cirr.com...[color=blue]
> B.r.K.o.N.j.A. <thebrkonja@inet.hr> spoke thus:
>[color=green]
> > I've been having trouble with sendto function
> > (etc.)[/color]
>
> 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.[/color]


Closed Thread