This commit is contained in:
twinaphex 2016-05-02 00:18:39 +02:00
parent 3adbbc0bde
commit e29b915536
2 changed files with 9 additions and 18 deletions

View File

@ -188,28 +188,21 @@ bool network_init(void)
sys_net_initialize_network();
#elif defined(VITA)
SceNetInitParam initparam;
/* Init Net */
if (sceNetShowNetstat() == PSP2_NET_ERROR_ENOTINIT)
{
_net_compat_net_memory = malloc(COMPAT_NET_INIT_SIZE);
initparam.memory = _net_compat_net_memory;
initparam.size = COMPAT_NET_INIT_SIZE;
initparam.flags = 0;
initparam.memory = _net_compat_net_memory;
initparam.size = COMPAT_NET_INIT_SIZE;
initparam.flags = 0;
sceNetInit(&initparam);
//printf("sceNetInit(): 0x%08X\n", ret);
/* Init NetCtl */
sceNetCtlInit();
}
else
{
//printf("Net is already initialized.\n");
}
retro_epoll_fd = sceNetEpollCreate("epoll", 0);
//printf("Epoll %x\n",retro_epoll_fd);
#else
signal(SIGPIPE, SIG_IGN); /* Do not like SIGPIPE killing our app. */
#endif
@ -228,6 +221,7 @@ void network_deinit(void)
#if defined(_WIN32)
WSACleanup();
#elif defined(__CELLOS_LV2__) && !defined(__PSL1GHT__)
cellNetCtlTerm();
sys_net_finalize_network();
cellSysmoduleUnloadModule(CELL_SYSMODULE_NET);
#elif defined(VITA)
@ -239,5 +233,7 @@ void network_deinit(void)
free(_net_compat_net_memory);
_net_compat_net_memory = NULL;
}
#elif defined(GEKKO) && !defined(HW_DOL)
net_deinit();
#endif
}

View File

@ -65,8 +65,7 @@ static int network_interface_up(struct sockaddr_in *target, int index,
*s = sceNetSocket("RA_netlogger", PSP2_NET_AF_INET, PSP2_NET_SOCK_DGRAM, 0);
target->sin_family = PSP2_NET_AF_INET;
target->sin_port = sceNetHtons(udp_port);
sceNetInetPton(PSP2_NET_AF_INET, ip_address, &target->sin_addr);
target->sin_addr = inet_aton(ip_address);
#else
#if defined(__CELLOS_LV2__) && !defined(__PSL1GHT__)
@ -116,11 +115,7 @@ static int network_interface_down(struct sockaddr_in *target, int *s)
{
int ret = socket_close(*s);
#if defined(__CELLOS_LV2__) && !defined(__PSL1GHT__)
cellNetCtlTerm();
#elif defined(GEKKO) && !defined(HW_DOL)
net_deinit();
#endif
network_deinit();
if (net_memory)
free(net_memory);