(RetroPad) Use socket_set_target

This commit is contained in:
twinaphex 2016-05-09 06:40:51 +02:00
parent e87f030246
commit 87b83ecf56
2 changed files with 8 additions and 9 deletions

View File

@ -234,7 +234,8 @@ void retro_run(void)
bool retro_load_game(const struct retro_game_info *info)
{
(void)info;
socket_target_t in_target;
check_variables();
s = socket_create(
@ -249,15 +250,11 @@ bool retro_load_game(const struct retro_game_info *info)
/* setup address structure */
memset((char *) &si_other, 0, sizeof(si_other));
si_other.sin_family = AF_INET;
si_other.sin_port = inet_htons(port);
#if defined(_WIN32) || defined(HAVE_SOCKET_LEGACY)
si_other.sin_addr.S_un.S_addr = inet_addr(server);
#else
si_other.sin_addr.s_addr = inet_addr(server);
in_target.port = port;
in_target.server = server;
in_target.domain = SOCKET_DOMAIN_INET;
inet_aton(server , &si_other.sin_addr);
#endif
socket_set_target(&si_other, &in_target);
log_cb(RETRO_LOG_INFO, "Server IP Address: %s\n" , server);

View File

@ -84,6 +84,8 @@ int socket_create(
enum socket_type socket_type,
enum socket_protocol protocol_type);
void socket_set_target(void *data, socket_target_t *in_addr);
RETRO_END_DECLS
#endif