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 : [EMAIL PROTECTED] 
Web Site : http://www.hymatom.fr 
====================================
P Avant d'imprimer, penser à l'environnement
 


-----Message d'origine-----
De : [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 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:
> [email protected], 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
[email protected] http://lists.nongnu.org/mailman/listinfo/lwip-users
BEGIN:VCARD
VERSION:2.1
N:BERNON;Frédéric;;M.
FN:Frédéric BERNON
ORG:HYMATOM SA;Recherche et Développement
TITLE:Chef de projet informatique
TEL;WORK;VOICE:04-67-87-61-10
TEL;WORK;FAX:04-67-70-85-44
ADR;WORK;ENCODING=QUOTED-PRINTABLE:;23;Zone Industrielle=0D=0A175 rue de Massacan;VENDARGUES;;34740;FRANCE;
LABEL;WORK;ENCODING=QUOTED-PRINTABLE:23=0D=0AZone Industrielle=0D=0A175 rue de Massacan=0D=0AVENDARGUES 34740=0D=
=0AFrance
URL;WORK:http://www.hymatom.fr
ROLE:Chef de projet informatique
EMAIL;PREF;INTERNET:[EMAIL PROTECTED]
REV:20020404T083210Z
END:VCARD
_______________________________________________
lwip-users mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/lwip-users

Reply via email to