mirror of
https://github.com/libretro/RetroArch
synced 2025-03-30 07:20:36 +00:00
(RetroPad) Use socket_set_target
This commit is contained in:
parent
e87f030246
commit
87b83ecf56
@ -234,7 +234,8 @@ void retro_run(void)
|
|||||||
|
|
||||||
bool retro_load_game(const struct retro_game_info *info)
|
bool retro_load_game(const struct retro_game_info *info)
|
||||||
{
|
{
|
||||||
(void)info;
|
socket_target_t in_target;
|
||||||
|
|
||||||
check_variables();
|
check_variables();
|
||||||
|
|
||||||
s = socket_create(
|
s = socket_create(
|
||||||
@ -249,15 +250,11 @@ bool retro_load_game(const struct retro_game_info *info)
|
|||||||
/* setup address structure */
|
/* setup address structure */
|
||||||
memset((char *) &si_other, 0, sizeof(si_other));
|
memset((char *) &si_other, 0, sizeof(si_other));
|
||||||
|
|
||||||
si_other.sin_family = AF_INET;
|
in_target.port = port;
|
||||||
si_other.sin_port = inet_htons(port);
|
in_target.server = server;
|
||||||
#if defined(_WIN32) || defined(HAVE_SOCKET_LEGACY)
|
in_target.domain = SOCKET_DOMAIN_INET;
|
||||||
si_other.sin_addr.S_un.S_addr = inet_addr(server);
|
|
||||||
#else
|
|
||||||
si_other.sin_addr.s_addr = inet_addr(server);
|
|
||||||
|
|
||||||
inet_aton(server , &si_other.sin_addr);
|
socket_set_target(&si_other, &in_target);
|
||||||
#endif
|
|
||||||
|
|
||||||
log_cb(RETRO_LOG_INFO, "Server IP Address: %s\n" , server);
|
log_cb(RETRO_LOG_INFO, "Server IP Address: %s\n" , server);
|
||||||
|
|
||||||
|
@ -84,6 +84,8 @@ int socket_create(
|
|||||||
enum socket_type socket_type,
|
enum socket_type socket_type,
|
||||||
enum socket_protocol protocol_type);
|
enum socket_protocol protocol_type);
|
||||||
|
|
||||||
|
void socket_set_target(void *data, socket_target_t *in_addr);
|
||||||
|
|
||||||
RETRO_END_DECLS
|
RETRO_END_DECLS
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user