Search results

  1. T

    bind() to INADDR_LOOPBACK

    I think I found it. I have the sockaddr_in as a local variable. Zeroing the struct before using it makes the bind() work. Must be junk in the struct (not unexpected) and the system call isn't ignoring it. Not sure what the POSIX/etc. specs say about that, but I've never had to zero it...
  2. T

    bind() to INADDR_LOOPBACK

    Here's my code (without the includes and error checking). I realize htons() and htonl() on a PPC are no-ops, just including them for correctness and portability. server = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); addr.sin_family = AF_INET; addr.sin_port =...
  3. T

    bind() to INADDR_LOOPBACK

    Ok, how come I can't bind to INADDR_LOOPBACK under MacOSX (10.3.4)? If I try to connect to 127.0.0.1 to something listening to INADDR_ANY, the two sockets are IPv6, so I suspect that's part of it, but lo0 is enabled for IPv4 at 127.0.0.1. This has always worked for me on other Unix systems...
Back
Top