Be aware that with pygecko, it will freeze the console if you launch a game, quit it, and then return to the browser.
(well for me it freezes, maybe it's the modifications i made on pygecko so i'm not sure)
To resolve the problem I had to add a "GX2WaitForVsync" in the start function of the pygecko codehandler :
Code:static void start(int argc, void *argv) { int sockfd = -1, clientfd = -1, ret, len; struct sockaddr_in addr; struct bss_t *bss = argv; socket_lib_init(); while (1) { addr.sin_family = AF_INET; addr.sin_port = 7331; addr.sin_addr.s_addr = 0; sockfd = ret = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); CHECK_ERROR(ret == -1); ret = bind(sockfd, (void *)&addr, 16); CHECK_ERROR(ret < 0); ret = listen(sockfd, 1); CHECK_ERROR(ret < 0); len = 16; clientfd = ret = accept(sockfd, (void *)&addr, &len); CHECK_ERROR(ret == -1); socketclose(sockfd); sockfd = -1; ret = rungecko(bss, clientfd); CHECK_ERROR(ret < 0); socketclose(clientfd); clientfd = -1; GX2WaitForVsync(); continue; error: if (clientfd != -1) socketclose(clientfd); if (sockfd != -1) socketclose(sockfd); bss->error = ret; GX2WaitForVsync(); }
I modified this section to withstand client side issues, but I will add that to my code.
Code:
addr.sin_family = AF_INET;
addr.sin_port = 7331;
addr.sin_addr.s_addr = 0;
sockfd = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); //open a file handle to socket
CHECK_ERROR(sockfd == -1);
ret = bind(sockfd, (void *)&addr, 16);
CHECK_ERROR(ret < 0);
ret = listen(sockfd, 20);
CHECK_ERROR(ret < 0);
while(1) {
len = 16;
clientfd = accept(sockfd, (void *)&addr, &len);
CHECK_ERROR(clientfd == -1);
ret = rungecko(bss, clientfd);
CHECK_ERROR(ret < 0);
socketclose(clientfd);
clientfd = -1;
}
socketclose(sockfd);
sockfd = -1;
error:
if (clientfd != -1)
socketclose(clientfd);
if (sockfd != -1)
socketclose(sockfd);
bss->error = ret;
}
[code]