feat update server
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -46,4 +46,5 @@ CTestTestfile.cmake
|
||||
_deps
|
||||
|
||||
build/
|
||||
.cache/
|
||||
vcpkg_installed
|
@@ -1,14 +1,16 @@
|
||||
#include <iostream>
|
||||
#include <cstdlib>
|
||||
#include <string>
|
||||
#include <cstring>
|
||||
#include <unistd.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/socket.h>
|
||||
#include <arpa/inet.h>
|
||||
#include <cstdlib>
|
||||
#include <cstring>
|
||||
#include <iostream>
|
||||
#include <netdb.h>
|
||||
#include <string>
|
||||
#include <sys/socket.h>
|
||||
#include <sys/types.h>
|
||||
#include <unistd.h>
|
||||
|
||||
int main(int argc, char **argv) {
|
||||
int
|
||||
main(int argc, char **argv)
|
||||
{
|
||||
// Flush after every std::cout / std::cerr
|
||||
std::cout << std::unitbuf;
|
||||
std::cerr << std::unitbuf;
|
||||
@@ -48,14 +50,14 @@ int main(int argc, char **argv) {
|
||||
std::cout << "Waiting for a client to connect...\n";
|
||||
|
||||
// You can use print statements as follows for debugging, they'll be visible when running tests.
|
||||
std::cout << "Logs from your program will appear here!\n";
|
||||
// std::cout << "Logs from your program will appear here!\n";
|
||||
|
||||
// Uncomment this block to pass the first stage
|
||||
//
|
||||
// accept(server_fd, (struct sockaddr *) &client_addr, (socklen_t *) &client_addr_len);
|
||||
// std::cout << "Client connected\n";
|
||||
accept(server_fd, (struct sockaddr *) &client_addr, (socklen_t *) &client_addr_len);
|
||||
std::cout << "Client connected\n";
|
||||
//
|
||||
// close(server_fd);
|
||||
close(server_fd);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
Reference in New Issue
Block a user