9 * \fn int main(int argc, char *argv[])
12 int main(int argc, char *argv[])
17 uint8_t buf[4] = {10,2,0,37};
18 uint8_t data[4096]; // Packet Data
20 con = open("/Devices/ip/1/tcpc", OPENFLAG_READ|OPENFLAG_WRITE);
22 fprintf(stderr, "Unable top open TCP client '/Devices/ip/1/tcpc'\n");
26 port = 80; ioctl(con, 5, &port); // Set Remote Port
27 ioctl(con, 6, buf); // Set remote IP
28 ioctl(con, 7, NULL); // Connect
30 #define REQ_STR "GET / HTTP/1.1\r\n"\
32 "User-Agent: Acess2 TCP Test Client\r\n"\
35 write(con, sizeof(REQ_STR)-1, REQ_STR);
37 len = read(con, 4096, data);
40 printf("Connection closed on us\n");
45 printf("Packet Data: (%i bytes)\n", len);
47 printf("--- EOP ---\n");