lwip-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE : [lwip-users] Some Help Needed Please


From: Frédéric BERNON
Subject: RE : [lwip-users] Some Help Needed Please
Date: Thu, 10 May 2007 18:29:07 +0200

1/ Be careful, "REUSE..." options are not supported by lwIP (see opt.h) :

/* Enable SO_REUSEADDR and SO_REUSEPORT options */ 
#ifndef SO_REUSE
#define SO_REUSE                        0
#endif

#if SO_REUSE
/* I removed the lot since this was an ugly hack. It broke the raw-API.
   It also came with many ugly goto's, Christiaan Simons. */
#error "SO_REUSE currently unavailable, this was a hack"
#endif

2/ 239.255.255.250 is a multicast address. I suppose you need to use IGMP 
(LWIP_IGMP=1), and IP_ADD_MEMBERSHIP & IP_DROP_MEMBERSHIP socket options.

3/ I'm agree with Kieran, you can use the same socket to send and recv (lwIP is 
not already "thread-safe", but if I think this is not a problem for 
sendto/recvfrom in UDP, I'm not so sure for "select"). You can also use another 
socket to send, but don't bind it to 1900/udp...
 
  
====================================
Frédéric BERNON 
HYMATOM SA 
Chef de projet informatique 
Microsoft Certified Professional 
Tél. : +33 (0)4-67-87-61-10 
Fax. : +33 (0)4-67-70-85-44 
Email : address@hidden 
Web Site : http://www.hymatom.fr 
====================================
P Avant d'imprimer, penser à l'environnement
 


-----Message d'origine-----
De : address@hidden [mailto:address@hidden De la part de Kieran Mansley
Envoyé : jeudi 10 mai 2007 18:15
À : Mailing list for lwIP users
Objet : Re: [lwip-users] Some Help Needed Please


On Wed, 2007-05-09 at 22:52 +0100, Julian Gardner [RSD] wrote:
> address@hidden, I have come to the end of my knowledge of 
> sockets etcs and i need some help getting some new code working (upnp)
> 
> What i am doing is opening a socket and then using select i can get 
> the data that is sent, (239.255.255.250:1900) but when i try to open a 
> port to send to this address i lose everything.
> 
> I think i need to use the REUSE_ADDR commands but would love a simple 
> demonstration of this, or some help
> 
> So i need to open a socket (udp) to recieve data from 
> 239.255.255.250:1900 and then i need to be able to send to the same 
> address and port!

If you have a socket opened to read, you should be able to send using the same 
socket, without closing it or opening another one.  Just use the same socket 
number that you use for reading.

Kieran



_______________________________________________
lwip-users mailing list
address@hidden http://lists.nongnu.org/mailman/listinfo/lwip-users

Attachment: Frédéric BERNON.vcf
Description: Frédéric BERNON.vcf


reply via email to

[Prev in Thread] Current Thread [Next in Thread]