9 * \fn int main(int argc, char *argv[])
12 int main(int argc, char *argv[])
19 uint8_t data[4096]; // Packet Data
21 srv = open("/Devices/ip/1/tcps", OPENFLAG_READ|OPENFLAG_EXEC);
23 fprintf(stderr, "Unable top open TCP server '/Devices/ip/1/tcps'\n");
26 port = 80; ioctl(srv, 4, &port); // Set Port
31 printf("Connection '/Devices/ip/1/tcps/%s'\n", buf);
32 con = _SysOpenChild(srv, buf, OPENFLAG_READ|OPENFLAG_WRITE);
34 fprintf(stderr, "Wtf! Why didn't this open?\n");
38 len = read(con, 4096, data);
40 printf("Connection closed\n");
46 printf("Packet Data: (%i bytes)\n", len);
48 printf("--- EOP ---\n");
51 #define RET_STR "HTTP/1.1 200 OK\r\n"\
52 "Content-Type: text/plain\r\n"\
53 "Content-Length: 92\r\n"\
55 "<html><head><title>Acess2 Web Server</title></head><body><h1>Hello World!</h1></body></html>\r\n"
57 write(con, sizeof(RET_STR), RET_STR);