gochatai/pachi_py/pachi/network.c
/* Open the gtp connection on the given port, redirect stdin & stdout to it. */
Open the gtp connection on the given port, redirect stdin & stdout to it.
Open the gtp connection on the given port redirect stdin & stdout to it .
void
open_gtp_connection(int *socket, char *port)
{
	static struct port_info gtp_info = { .socket = -1 };
	gtp_info.port = port;
	int gtp_conn = open_connection(&gtp_info);
	for (int d = STDIN; d <= STDOUT; d++) {
		if (dup2(gtp_conn, d) < 0)
			die("dup2");
	}
	if (DEBUGL(0))
		fprintf(stderr, "gtp connection opened\n");
}
void open_gtp_connection ( int * socket , char * port ) { static struct port_info gtp_info = { . socket = -1 } ; gtp_info . port = port ; int gtp_conn = open_connection ( & gtp_info ) ; for ( int d = STDIN ; d <= STDOUT ; d ++ ) { if ( dup2 ( gtp_conn , d ) < 0 ) die ( " " ) ; } if ( DEBUGL ( 0 ) ) fprintf ( stderr , " \n " ) ; }
Open the gtp connection on the given port, redirect stdin & stdout to it.
Open the gtp connection on the given port redirect stdin & stdout to it .