I am trying to send files from my PC to my PS2 over the internet using a router. Here is some of the code for the socket I have.
Using ps2ip.
Loading irx modules:
Snippet of server initialization:
I can somewhat get past the limit by following the first recv with another recv, but there is packet loss. If I raise the recv size to something higher than 1024, it just follows the first 1024 bytes with 0x00.
So anyway can I recv data that has a size greater than 1 kb?
Thanks.
Using ps2ip.
Loading irx modules:
Code:
int LoadIRX()
{
int a;
scr_printf(" Beginning initialization!\n");
a = SifExecModuleBuffer(&POWEROFF_IRX, size_POWEROFF_IRX, 0, NULL, &a);
if (a < 0 )
{
scr_printf(" Could not load POWEROFF.IRX! %d\n", a);
return -1;
}
scr_printf(" Loaded POWEROFF.IRX!\n");
a = SifExecModuleBuffer(&PS2DEV9_IRX, size_PS2DEV9_IRX, 0, NULL, &a);
if (a < 0 )
{
scr_printf(" Could not load PS2DEV9.IRX! %d\n", a);
return -1;
}
scr_printf(" Loaded PS2DEV9.IRX!\n");
a = SifExecModuleBuffer(&PS2IP_IRX, size_PS2IP_IRX, 0, NULL, &a);
if (a < 0 )
{
scr_printf(" Could not load PS2IP.IRX!\n %d", a);
return -1;
}
scr_printf(" Loaded PS2IP.IRX!\n");
a = SifExecModuleBuffer(&DNS_IRX, size_DNS_IRX, 0, NULL, &a);
if (a < 0)
{
scr_printf(" Could not load DNS.IRX! %d\n", a);
return -1;
}
scr_printf(" Loaded DNS.IRX!\n");
a = SifExecModuleBuffer(&PS2IPS_IRX, size_PS2IPS_IRX, 0, NULL, &a);
if (a < 0)
{
scr_printf(" Could not load PS2IPS.IRX! %d\n", a);
return -1;
}
scr_printf(" Loaded PS2IPS.IRX!\n");
//Taken from http://forums.ps2dev.org/viewtopic.php?t=11553&highlight=ps2ipinit
//Credit to methos3
char *IP = ReadIP();
char *NM = ReadNM();
char *GW = ReadGW();
char *args = malloc(strlen(IP) + strlen(NM) + strlen(GW) + 3);
int b = 0;
memset(&b, 0, sizeof(b + 1));
strcpy(&args[b], IP); b+=strlen(IP)+1;
strcpy(&args[b], NM); b+=strlen(NM)+1;
strcpy(&args[b], GW); b+=strlen(GW)+1;
a = SifExecModuleBuffer(&SMAP_IRX, size_SMAP_IRX, b, args, &a);
if (a < 0)
{
scr_printf(" Could not load SMAP.IRX! %d\n", a);
return -1;
}
scr_printf(" Loaded SMAP.IRX!\n");
scr_printf(" Loaded irx modules\n");
a = ps2ip_init();
if (a < 0)
{
scr_printf(" Could not initialize ps2ip %d\n", a);
return -1;
}
scr_printf(" Initialized ps2ip!\n");
scr_clear();
return 0;
}
Code:
sockfd = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP ); serv_addr.sin_family = AF_INET; serv_addr.sin_addr.s_addr = htonl(INADDR_ANY); serv_addr.sin_port = htons(2345); bind(sockfd, (struct sockaddr *) &serv_addr, sizeof(serv_addr); // Using send and recv, n is declared as 0 // newsockfd is created when the connection between the PC and the PS2 is made // Yes it says 1024, but that is because I haven't gotten it to go past 1 kb // If I could, I would increase it, so right now I just go with it char buffer[1024]; n = recv(newsockfd, buffer, 1024, 0);
So anyway can I recv data that has a size greater than 1 kb?
Thanks.
Comment