The net_getsockname() function seems to be missing. I added the following implementation and it seems to work:
s32 net_getsockname(s32 s, struct sockaddr *addr, socklen_t *addrlen)
{
STACK_ALIGN(u32, _socket, 1, 32);
STACK_ALIGN(u8, _addr, sizeof(struct sockaddr), 32);
s32 ret;
if (net_ip ...
Search found 4 matches
- Thu Jun 13, 2013 2:07 am
- Forum: Bug Reports
- Topic: [devkitPPC/libogc] getsockname() missing
- Replies: 0
- Views: 12669
- Thu Jun 13, 2013 2:05 am
- Forum: Bug Reports
- Topic: [devkitPPC/libogc] struct sockaddr_storage is missing
- Replies: 0
- Views: 11258
[devkitPPC/libogc] struct sockaddr_storage is missing
In network.h, there's only struct sockaddr and struct sockaddr_in, but no struct sockaddr_storage. struct sockaddr_storage is defined by POSIX. It should be a struct big enough to hold any sockaddr_* struct in the system. The following simple definition will suffice:
struct sockaddr_storage {
u8 ...
struct sockaddr_storage {
u8 ...
- Thu Jun 13, 2013 2:03 am
- Forum: Bug Reports
- Topic: [devkitppc/libogc] net_bind to port 0 doesn't work
- Replies: 0
- Views: 11155
[devkitppc/libogc] net_bind to port 0 doesn't work
When trying to net_bind() to port 0, the bind fails instead of choosing a free port. I can't find anything in POSIX about this (it says it's protocol-dependent), but every OS seems to handle it that way.
- Thu Jun 13, 2013 1:59 am
- Forum: Bug Reports
- Topic: [devkitPPC/libogc] net_gethostbyname does not work with IPs
- Replies: 0
- Views: 11178
[devkitPPC/libogc] net_gethostbyname does not work with IPs
When trying to use net_gethostbyname() with an IP, it returns a resolve error.
This not only means that you have to check whether the address is an IP first and then use inet_addr(), it also means it breaks with how gethostbyname() works on any other OS, thus making ports unnecessarily hard ...
This not only means that you have to check whether the address is an IP first and then use inet_addr(), it also means it breaks with how gethostbyname() works on any other OS, thus making ports unnecessarily hard ...