Skip to main content
Share Your Experience: Take the 2024 Developer Survey
16 votes
Accepted

C Socket Part-1

I can't resist saying this… the way you use a lot of whitespace to achieve your horizontal alignment, especially in server.cpp, is distracting and hinders ...
200_success's user avatar
13 votes
Accepted

Event Based TCP Library

This won't be comprehensive review/ramble, because I'm hungry; however, it is nice to see fairly comprehensive inline documentation on the public API! General Networking Commentary Because you asked ...
VisualMelon's user avatar
  • 7,431
11 votes

C Socket Part-1

One of the issues with TCP sockets is that there's no guarantee that sending N bytes in one go will result in receiving exactly N bytes after one call to read(). I ...
D. Jurcau's user avatar
  • 3,010
10 votes
Accepted

Simple HTTP Server

Note: This review focuses on the use of C++, rather than the functionality. Naming: IMHO, the use of "do" at the start of function names is unnecessary and makes the code harder to read. The names ...
user673679's user avatar
  • 11.8k
10 votes

Saving form data to a text file on server

All I can do is repeat what I already told you on StackOverflow: this code is crippling the data and stores a fake IP address. The main problem with your code is that you don't understand what does it ...
Your Common Sense's user avatar
9 votes
Accepted

Basic Python HTTP Server

ServerSocket self.handler The handler evaluation in __init__ can be accomplished with an or ternary operation. It's clearer to ...
C.Nivs's user avatar
  • 2,947
9 votes

TCP server in C++

Header files should end in .h or .hpp Everything except Program.cpp looks like a header file, not a source file. Make sure the filenames of the header files end in .hpp. See this StackOverflow ...
G. Sliepen's user avatar
8 votes
Accepted

TCP client and server API

I don't understand the point of the IComponent / IComponentConsumer stuff. Nothing else in the large section of code you've ...
Peter Taylor's user avatar
  • 24.1k
7 votes
Accepted

Client Server code in OCaml style

Using semicolons is OK. The IO is imperative and side-effectfull by default, so there is nothing to do here. By saying Lwt_unix.listen sock max_pending_request you'...
ivg's user avatar
  • 311
7 votes

C Socket Part-1

Some issues that occur to me: The obvious problem is that there is no error checking. memset is often preferred to bzero, ...
William Morris's user avatar
7 votes
Accepted

Game Networking between 2 players

Your vertical separation is good, you've got clear regions in your code for defining the objects you need like sockets, readers and writers, etc. There's one region that needs cleaning, though: ...
Pimgd's user avatar
  • 22.3k
7 votes
Accepted

Simple Rust Webserver

Learn to love rustfmt: Spaces go between comma-separated items: -use std::io::{Read, Write,BufReader, BufRead}; +use std::io::{Read, Write, BufReader, BufRead}; ...
Shepmaster's user avatar
  • 8,658
6 votes
Accepted

Simple Multi-Threaded Web Server

First of all, I really liked your C++ code and even though I am not a professional I think there are some points to consider. To the future! It is 2016 so I would say we can safely use C++11 today (...
henje's user avatar
  • 342
6 votes
Accepted

C++ Socket Part-2

A public non-virtual destructor in a base class is risky. You should consider making it protected, or otherwise virtual, if ...
glampert's user avatar
  • 17.1k
6 votes

Backup document root and MySQL in Linux

Since you are repeatedly using $(date +\%F-\%T), you can store that as a variable (unless you want to also know how long it took the script to jump between ...
hjpotter92's user avatar
  • 8,716
6 votes

Simple HTTP Server

It's not bad code for someone new to C++. Here are some observations and suggestions that may help you improve your code. Avoid relative paths in #includes ...
Edward's user avatar
  • 66.4k
6 votes
Accepted

Login Server with Node.js

Just addressing one of your questions. "SECURITY: Is my website secure in any way, shape, or form?" No it is not!!! Reasons Insecure transport. You should never send private data via an ...
Blindman67's user avatar
  • 22.1k
6 votes
Accepted

Debian-Apache-MySQL-PHP-HTTPS version-agnostic environment bootstrapper

Firstly, it's wrong to write a Bash shebang at the start of .profile, for two reasons: It's not an executable script, but intended to be sourced from other shell ...
Toby Speight's user avatar
  • 75.7k
6 votes
Accepted

Node.js backend login logic

Async login bug The try/catch around User.findOne does not accomplish anything because ...
CertainPerformance's user avatar
5 votes
Accepted

Server connection handler in Python

1. Review There are no docstrings. What do these functions and classes do? How do I use them? In Python, it's conventional to use a single underscore to indicate a method that's only intended for use ...
Gareth Rees's user avatar
  • 49.6k
5 votes

Common client server implementation

Who am I? When skimming the code, it's not obvious to a reader what the significance of checking whether a string starts with the letter "c". ...
jacwah's user avatar
  • 2,661
5 votes
Accepted

NodeJS static file HTTP server

There are more efficient ways to do this. Now you are buffering the whole file content into memory, when you perform fs.readFile(...). I recommend that you use a <...
Jan Grz's user avatar
  • 210
5 votes

My first implementation of a client/server application

Naming Usually, local variables start with a small letter. StartListening If the method is called multiple times, it will throw an exception that the endpoint is already in use. Not very robust. <...
JanDotNet's user avatar
  • 8,538
5 votes
Accepted

cron daily and weekly scripts for a minimal Nginx server environment

As mentioned by cas in the discussion, you can simplify your loops: ...
Stephen Kitt's user avatar
5 votes
Accepted

Backup document root and MySQL in Linux

zip -r /var/www/html/html-$(date +\%F-\%T).zip /var/www/html -x "*/cache/*" You're making the backup directly available in your web root. For temporary files you ...
Peter Taylor's user avatar
  • 24.1k
5 votes
Accepted

Serving a webpage that displays the HTTP request information sent by the client

Can I use other modules to make this job easier? You can use some web framework like fastify or express. This would ease the code a lot For a job this simple, is it worth to work with HTML and CSS ...
Manuel Spigolon's user avatar
4 votes

C Socket Part-1

There is a problem with the naming of your files. The .c extension is for the C language and the .cpp extension is for the C++ language. The tag on this question is c, so the expectation is the file ...
user3629249's user avatar
  • 2,818
4 votes

Multithreaded Client/ Server communication

If the client sends some data and immediately disconnects, the server's write will fail, and the server receives a SIGPIPE signal. This signal is fatal, and server is terminated. You need to handle ...
vnp's user avatar
  • 56.5k
4 votes

Multithreaded Client/ Server communication

Should not assume null termination This code in the server assumes that the client will send null terminated data: ...
JS1's user avatar
  • 28.5k

Only top scored, non community-wiki answers of a minimum length are eligible