israr
Joined: 08 Jul 2008 Posts: 5
|
Posted: Tue Jul 08, 2008 3:36 pm Post subject: send/recv from a thread.. |
|
|
I can successfully create a socket and accept connection on that socket.
send/recv works fine on the new connected socket. However When I create a thread, try to call recvin that thread, recv returns an -1 , and errno is set to 0x80410005.
| Code: |
newsock = accept(sd, &sockaddr, &addrlen);
if(newsock == -1)
{
printf("Invalid new connection received\n");
closesocket(sd);
return -1;
}
printf("Accepted a new connection: %d\n",newsock);
gNewSock = newsock; //assign to a global var
//testSock(); // this function calls recv on gNewSock, and works fine.
thid = sceKernelCreateThread("childThread", testSock, 0x11, 0xFA0, PSP_THREAD_ATTR_USER, 0); // testSock doesnt works fine from thread..
|
I even tried creating thread with PSP_THREAD_ATTR_USER|PSP_THREAD_ATTR_USBWLAN flags, but that also didnt work. Do I need to somehow duplicate the socket handle in new thread?? or I can use the same handle?
I tried looking up 0x80410005 in error codes but could not find it. I am building as prx, and downloading to a 3.71 m33 via USBHostFs. |
|