+ int val = 1;
+ setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, &val, sizeof(val));
+
+ server_addr.sin_family = AF_INET;
+ server_addr.sin_addr.s_addr = htonl(INADDR_ANY);
+ server_addr.sin_port = htons(SIMPLESTORE_PORT);
+ if (bind(fd, (struct sockaddr *)&server_addr, sizeof(server_addr)) < 0) {
+ perror("bind");
+ exit(1);
+ }
+