netdemo

aling aling987 at 163.com
Wed Nov 12 07:56:53 UTC 2003


I use "netdemo" to test the network driver.
 In test.c,there is:
#define DATA_SINK_HOST ((128 < <  24) | (233 < <  16) | (14 < <  8) | 60)

static void
transmitTcp(void)
{
....
    farAddr.sin_family = AF_INET;
  farAddr.sin_port = htons (9); /* The `discard' port */
  farAddr.sin_addr.s_addr = htonl (DATA_SINK_HOST);
  printf ("Connect socket.\n");
   if (connect (s, (struct sockaddr *)&farAddr, sizeof farAddr) <  0) {
   printf ("Can't connect socket: %s\n", strerror (errno));
  close (s);
  return;
  }
-----
}

At first,I didn't change them and ran them.When I typed 't',the following information was on the target console .
"t
Create socket.
Bind socket.
Connect socket.
Can't connect socket: Connection timed out
"
Then , I changed  "#define DATA_SINK_HOST ((128 < <  24) | (233 < <  16) | (14 < <  8) | 60)" into 
"#define DATA_SINK_HOST ((192 < <  24) | (168 < <  16) | (1 < <  8) | 30)".
The IP address of  my host is 192.168.1.30.
the output information:
"t
Create socket.
Bind socket.
Connect socket.
Can't connect socket: Connection rejected.
"
I am anxious to get your help.







More information about the users mailing list