Hi all,
currently i'm working on a client-server application...
when doing an UDP-broadcast the packet is received ok, at the other side,
but for some reason after that
_ANOTHER_ packet is received that has source-address 255.255.255.255, which
i didn't send.
This packet generates an error when received :( :
error 10054 - connection reset by peer
below is what i use to receive, and the piece of code to set the options:
----------------------------------------------------------------------------
--------------------------------------------
recvfrom( GlobalSocket, tempBuff, sizeof(tempBuff), (int)NULL, (SOCKADDR
*)&remote_sockaddr_in,(int *) )
----------------------------------------------------------------------------
--------------------------------------------
&remote_sockaddr_length);
//ENABLE BROADCAST
BOOL fBroadcast = TRUE;
int err = setsockopt ( GlobalSocket,
SOL_SOCKET,
SO_BROADCAST,
(CHAR *) &fBroadcast,
sizeof ( BOOL )
);
----------------------------------------------------------------------------
--------------------------------------------
Is anybody familiar with this? What could be causing this?
Thanks in advance,
Mark
|
|
0
|
|
|
|
Reply
|
news2217 (3)
|
9/1/2003 3:11:32 PM |
|
> currently i'm working on a client-server application...
> when doing an UDP-broadcast the packet is received ok, at the other
side,
> but for some reason after that
> _ANOTHER_ packet is received that has source-address 255.255.255.255,
which
> i didn't send.
>
> This packet generates an error when received :( :
> error 10054 - connection reset by peer
>
> below is what i use to receive, and the piece of code to set the
options:
> ----------------------------------------------------------------------
------
> --------------------------------------------
> recvfrom( GlobalSocket, tempBuff, sizeof(tempBuff), (int)NULL,
(SOCKADDR
> *)&remote_sockaddr_in,(int *) )
> ----------------------------------------------------------------------
------
> --------------------------------------------
> &remote_sockaddr_length);
> file://ENABLE BROADCAST
> BOOL fBroadcast = TRUE;
> int err = setsockopt ( GlobalSocket,
> SOL_SOCKET,
> SO_BROADCAST,
> (CHAR *) &fBroadcast,
> sizeof ( BOOL )
> );
> ----------------------------------------------------------------------
------
> --------------------------------------------
> Is anybody familiar with this? What could be causing this?
Standard C++ has no support for socket communication, hence your
question is off-topic here. For suggestions were to post read this
http://home.wanadoo.nl/efx/c++-faq/how-to-post.html#faq-5.9 and this
http://www.slack.net/~shiva/welcome.txt
--
Peter van Merkerk
peter.van.merkerk(at)dse.nl
|
|
0
|
|
|
|
Reply
|
merkerk (462)
|
9/1/2003 3:34:04 PM
|
|
Oops, sorry...
Anyway...problem is solved now....seems that the packets where too long :s
"Peter van Merkerk" <merkerk@deadspam.com> wrote in message
news:bivp0l$dp5lc$1@ID-133164.news.uni-berlin.de...
> > currently i'm working on a client-server application...
> > when doing an UDP-broadcast the packet is received ok, at the other
> side,
> > but for some reason after that
> > _ANOTHER_ packet is received that has source-address 255.255.255.255,
> which
> > i didn't send.
> >
> > This packet generates an error when received :( :
> > error 10054 - connection reset by peer
> >
> > below is what i use to receive, and the piece of code to set the
> options:
> > ----------------------------------------------------------------------
> ------
> > --------------------------------------------
> > recvfrom( GlobalSocket, tempBuff, sizeof(tempBuff), (int)NULL,
> (SOCKADDR
> > *)&remote_sockaddr_in,(int *) )
> > ----------------------------------------------------------------------
> ------
> > --------------------------------------------
> > &remote_sockaddr_length);
> > file://ENABLE BROADCAST
> > BOOL fBroadcast = TRUE;
> > int err = setsockopt ( GlobalSocket,
> > SOL_SOCKET,
> > SO_BROADCAST,
> > (CHAR *) &fBroadcast,
> > sizeof ( BOOL )
> > );
> > ----------------------------------------------------------------------
> ------
> > --------------------------------------------
> > Is anybody familiar with this? What could be causing this?
>
> Standard C++ has no support for socket communication, hence your
> question is off-topic here. For suggestions were to post read this
> http://home.wanadoo.nl/efx/c++-faq/how-to-post.html#faq-5.9 and this
> http://www.slack.net/~shiva/welcome.txt
>
> --
> Peter van Merkerk
> peter.van.merkerk(at)dse.nl
>
>
|
|
0
|
|
|
|
Reply
|
news2217 (3)
|
9/1/2003 4:10:20 PM
|
|
|
2 Replies
147 Views
(page loaded in 0.025 seconds)
Similiar Articles: UDP Broadcast problem - comp.lang.c++UDP 123 Port restriction - comp.protocols.time.ntp > Broadcast might solve this problem. If you can use broadcast then you > are not using 123. UDP 123 Port restriction - comp.protocols.time.ntp> Broadcast might solve this problem. If you can use broadcast then you > are not using 123. All ntpd modes use UDP/123 as the source and destination address. How to block bootp/dhcp broadcasting on cisco routers? - comp.dcom ...Hi, How can I block bootp/dhcp broadcast at cisco routers? ... commands Even I tryed "no ip forward-protocol udp ... No need to post you problem twice. But a full config ... unicast and broadcast on same socket - comp.unix.programmer ...How can I receive both unicast and broadcast datagram ... I have a Linux application that opens a UDP socket and binds it to a port. I haven't had any problem sending ... recvfrom returns with an error code of 14, EFAULT "Bad Address ...Whenever I try to retreive a udp packet sent via broadcast I get the errorcode EFAULT(bad address). ... This is the main problem I am haveing. Before I pass the point to recvfrom ... Sending UDP packets over Ethernet - comp.arch.fpgaYou could also broadcast. (Set the destination to X ... The main problem it does have is that if you change ... lang.python... the free encyclopedia The User Datagram Protocol ... Solaris 9 x86 CDE not starting remotely via XDMCP - comp.unix ...I tried XDM broadcast, no joy; (returns XDMCP connection failed) XDM Query (UDP port 177 or 32771), no joy ... If it's solid black, I might think font issues ... Ip helper-address and pxe-client - comp.dcom.sys.ciscoHello, we have got the problem: we have a cat.4506 just ... Generally they are broadcast on the appropriate interface ... The interface configuration, debug ip udp, and debug ... broadcasting - comp.unix.programmerYour client broadcasts or multicasts a UDP datagram. Your servers ... Other wireless PC can/do have dynamic IP's. > > > >Problem is that the AP is not broadcasting the DHCP ... Locating a rogue DHCP server? - comp.dcom.sys.ciscoI've had to deal with this problem before as well. ... to worry about that user affecting the entire broadcast ... ACL on all access-layer > interfaces that blocks UDP ... c - UDP broadcast problem - Stack OverflowI'm trying to do something like this. There is one server , and multiple clients in the same subnet. Clients will send something to server and server will send this ... C# udp broadcast problem - Microsoft Corporation: Software ...Hello, I have a problem with receiving UDP broadcast data with my C# application. Here's the scenario: I have a device that sends out a UDP broadcast to IP ... 7/25/2012 12:50:22 AM
|