+void open_filedescriptors()
+{
+ struct sockaddr_in sa;
+
+ bzero((char *) &sa, sizeof(sa));
+ sa.sin_family = AF_INET;
+ sa.sin_addr.s_addr = INADDR_ANY;
+ sa.sin_port = htons(8124);
+
+ if((sock_fd = socket(AF_INET, SOCK_STREAM, 0)) == -1)
+ pdie("socket");
+ if(bind(sock_fd, (struct sockaddr*)&sa, sizeof(sa)) == -1)
+ pdie("bind\n");
+ if(listen(sock_fd, 10) == -1)
+ pdie("bind\n");
+
+ printf("Listinging on 8123\n");
+ fflush(stdout);
+ if((fd = accept(sock_fd, (struct sockaddr*)NULL, NULL)) == -1)
+ pdie("accept");
+}
+