Beispiel #1
0
int init_socket() {
  if (unix_socket) {
    return init_unix_socket();
  } else {
    return init_tcp_socket();
  }
}
Beispiel #2
0
static bool init_socket(netplay_t *netplay, const char *server, uint16_t port)
{
   if (!network_init())
      return false;

   if (!init_tcp_socket(netplay, server, port, netplay->spectate.enabled))
      return false;

   return true;
}
Beispiel #3
0
static bool init_socket(netplay_t *handle, const char *server, uint16_t port)
{
   if (!netplay_init_network())
      return false;

   if (!init_tcp_socket(handle, server, port, handle->spectate))
      return false;
   if (!handle->spectate && !init_udp_socket(handle, server, port))
      return false;

   return true;
}
Beispiel #4
0
static bool init_socket(netplay_t *netplay, void *direct_host, const char *server, uint16_t port)
{
   if (!network_init())
      return false;

   if (!init_tcp_socket(netplay, direct_host, server, port))
      return false;

   if (netplay->is_server && netplay->nat_traversal)
      netplay_init_nat_traversal(netplay);

   return true;
}
Beispiel #5
0
void _native_init_uart0(char *stdiotype, char *ioparam)
{
    if (strcmp(stdiotype, "tcp") == 0) {
        _native_uart_sock = init_tcp_socket(ioparam);
    }
    else if (strcmp(stdiotype, "unix") == 0) {
        _native_uart_sock = init_unix_socket();
    }
    else if (strcmp(stdiotype, "stdio") == 0) {
        _native_uart_sock = -1;
        _native_uart_conn = 1;
    }
    else if (strcmp(stdiotype, "null") == 0) {
        _native_uart_sock = -1;
        _native_uart_conn = 0;
    }
    else {
        errx(EXIT_FAILURE, "_native_init_uart0: unknown stdio type");
    }

    puts("RIOT native uart0 initialized.");
}