Can I suggest to try with these little changes ?

>     sock = socket( AF_INET, SOCK_DGRAM, 0);
> 
>     memset( ( void * )&sockAddr, 0, sizeof( struct sockaddr_in ) );
>     sockAddr.sin_family = AF_INET;
>     sockAddr.sin_addr.s_addr = htonl(INADDR_ANY);
>     sockAddr.sin_port = htons(port);
>     if( bind( sock, ( struct sockaddr * )&sockAddr, sizeof( sockAddr ) 
> )
> !=0)
>     {
>     }
> 

 
  
====================================
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é : lundi 21 janvier 2008 12:24
À : Mailing list for lwIP users
Objet : RE: [lwip-users] Has any work been done on allowing sendandreceive on a 
single port


On Mon, 2008-01-21 at 11:11 +0000, Julian Gardner [RSD] wrote:
> Ive done
> 
>     sock = socket( AF_INET, SOCK_DGRAM, IPPROTO_UDP);
> 
>     memset( ( void * )&sockAddr, 0, sizeof( struct sockaddr_in ) );
>     sockAddr.sin_family = AF_INET;
>     sockAddr.sin_addr.s_addr = INADDR_ANY;
>     sockAddr.sin_port = port;
>     if( bind( sock, ( struct sockaddr * )&sockAddr, sizeof( sockAddr ) 
> )
> !=0)
>     {
>     }
> 
> Now do i need to do anything else to make this bi-directional?.

I'm still not clear what you're trying to achieve.

All sockets are by default one-to-one and bi-directional.

If you just need to do bi-directional communication between two computers (A 
sends to B, B sends back to A), you should get that with no trouble at all with 
a normal socket.

If you want three computers (i.e. A sends to B, and B sends to C) then B will 
need two sockets.  It can't use one socket for both receiving from A and 
sending to C as sockets are normally just one-to-one.  Both those sockets can 
be on the same address and port at B (I think) though.  You may have to be a 
bit careful about how you bind them to ensure they don't "overlap".

You may, if that doesn't fulfill your needs, be able to do something with 
multicast (as then the socket isn't just one-to-one) but that's a whole 
different kettle of fish.

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