forums.ps2dev.org Forum Index forums.ps2dev.org
Homebrew PS2, PSP & PS3 Development Discussions
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Bind to INADDR_LOOPBACK fails

 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development
View previous topic :: View next topic  
Author Message
monsti



Joined: 04 Mar 2007
Posts: 13
Location: Germany

PostPosted: Sun Mar 04, 2007 8:56 am    Post subject: Bind to INADDR_LOOPBACK fails Reply with quote

Hi,

the following example code - gaken from samples/net/simple fails.

I want to bind only to INADDR_LOOPBACK.

Code:

    uint16_t port = 10000;
    int sock;
    int ret;
    struct sockaddr_in name;

    sock = socket(AF_INET, SOCK_STREAM, 0);
    if(sock < 0)
    {
        return;
    }

    name.sin_port =  htons(port);
    name.sin_family = AF_INET;
    //name.sin_addr.s_addr = htonl (INADDR_LOOPBACK); // fails - why?
    name.sin_addr.s_addr = htonl(INADDR_ANY); // works...

    ret = bind(sock, (struct sockaddr *) &name, sizeof(name));
    if(ret < 0)
    {
       printf( "bind failed...\n" );
        return;
    }


Any idea?
_________________
Bye,
Monsti
Back to top
View user's profile Send private message
jimparis



Joined: 10 Jun 2005
Posts: 1179
Location: Boston

PostPosted: Mon Mar 05, 2007 5:30 am    Post subject: Reply with quote

The PSP is not Unix... AFAIK it has no loopback interface.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development All times are GMT + 10 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group