[SDL] Net2: question
vasvir at iit.demokritos.gr
Fri Sep 8 01:19:14 PDT 2006
I am investigating SDL_Net and I am using the
excellent Net2 library by Bob Pendleton. Note that
Net2 is a thin layer around SDL_net and does not perform
But I think it should do.
I am calling
NET2_UDPAcceptOn(int port) which calls
which accepts native byte order integer. So far so good.
Now when I am receiving UDP packets on this port, the
source port number is swapped. OK. let's just accept
that. This is the network.
Now when I am trying to send using
NET2_UDPSend(IPaddress *ip, char *buf, int len) which calls
the ip->port member must be jammed again -- unlike the other uses
I believe since NET2_UDPSend requires an IPaddress it should
be noted with __very__ big letters in the documentation.
better hide the swap inside NET2_UDPSend and during the receipt
of the UDPpacket.
More information about the SDL