gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

DS development > sendmsg missing in dswifi lib.

#175384 - 3dfx - Mon Nov 08, 2010 2:37 pm

Hey guys, I wish to port one of my projects which uses enet extensively to the DS but unfortunately, the dswifi lib doesnt implement sendmsg which enet requires. Does anybody happen to know a workaround for this ?

Many thanks.

#175385 - elhobbs - Mon Nov 08, 2010 4:41 pm

you can probably implement sendmsg yourself using sendto for udp and send for tcp. you should be able to tell udp from tcp using getpeername which will return an error for udp in that case you will need to sendto using the address in the msghdr parameter. getpeername will also return an error if the tcp socket is not connected. the error codes are different though, not supported and not connected respectively.

#175386 - 3dfx - Wed Nov 10, 2010 10:37 am

Ahh yes thank you. I looked through some sendmsg sources and it's really simple. Plus enet is exclusively a udp library so i can know for sure to onlly use sendto / recvfrom.