Commit ffff6674 authored by Dafydd Harries's avatar Dafydd Harries
Browse files

ice-test-client: take server address as argument

darcs-hash:20070203100351-c9803-4cba76151d89c5a12ed4ef5b4e31ea9d6f9d70f2.gz
parent 1c73b5bd
......@@ -114,20 +114,26 @@ OUT:
}
int
main (void)
main (gint argc, gchar *argv[])
{
struct sockaddr_in sin = {0,};
gint sock;
sock = socket (AF_INET, SOCK_STREAM, 0);
if (argc != 2)
{
g_print ("usage: %s server\n", argv[0]);
return 1;
}
if (sock < 0)
{
g_print ("failed to create socket\n");
return 1;
}
if (inet_pton (AF_INET, "127.0.0.1", &sin.sin_addr) < 1)
if (inet_pton (AF_INET, argv[1], &sin.sin_addr) < 1)
{
g_print ("invalid address\n");
return 1;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment