Skip to main content
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
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.2k
5 votes

Handling Server Responses

Having bool Succeeded, bool Failed and bool Errored as members of the ...
D. Jurcau's user avatar
  • 3,010
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

Library to be used against a specific REST web service

Creating a session As a library, I find it barely usable. If I want to use it with my own credentials, I have to: either modify the source of your library to put them in ...
301_Moved_Permanently's user avatar
5 votes

Custom HttpClient implementation for third part usage with sync/async calls

internal class Client : IDisposable { private static HttpClient _client; private static Uri _baseAddress; Neither of those fields should be ...
Peter Taylor's user avatar
  • 24.2k
5 votes
Accepted

Send and receive functions for telnet client

General Observations The code could be made more maintainable (easier to read, write, and debug) through reduction of redundant code and simplification. There is a possible bug in ...
pacmaninbw's user avatar
  • 24.8k
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
  • 57.3k
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.6k
4 votes
Accepted

Extendable REST-Client

I'm working on something of a simple REST client myself and I wonder if my core bit might be able to help your implementation and vice-versa. I'll just post a tiny bit here (the generic GET async ...
Jesse C. Slicer's user avatar
4 votes

Handling Server Responses

I personally prefer something like a generic ActionResult<T> class that allows me the re-usability of a single data structure for handling responses that ...
Icepickle's user avatar
  • 825
4 votes

CloudFlare Dynamic DNS Update Script in Python 3

Docstrings You should really consider switching to Docstrings instead of using your current documentation method. (Note that using Docstrings will give the function a ...
Dair's user avatar
  • 6,008
4 votes
Accepted

API client to retrieve traffic news

Caching your MD5 hash is premature optimisation, and indeed there are more important things you should be caring about. For instance, you're serialising JSON twice; instead you should use a Requests ...
Reinderien's user avatar
  • 65.2k
3 votes
Accepted

Getting prices of crypto coins

Well, I shall start from the top. According to the style guide, PEP 8 imports should be in the following order: standard library imports related third party imports local application/...
Walid Mujahid وليد مجاهد's user avatar
3 votes
Accepted

Document Management Properties and Searching

On first glance this isn't bad, though I hate some of the naming. Let's look at some of it in particular to see what's going on: ...
Der Kommissar's user avatar
3 votes
Accepted

Networked Chat App in Python

This is pretty clean code, good job. I'll be reviewing each file in order, and then I'll you some extra advice at the end. server.py General If a statement consists of multiple names, like in a ...
Daniel's user avatar
  • 4,500
3 votes

Multithreaded Client/ Server communication

You have a bug here: int socket_desc , client_sock , c , *new_sock; new_sock = malloc(1); You're allocating 1 byte with the ...
forsvarir's user avatar
  • 11.7k
3 votes

C++ Socket Part-2

I've been looking over your code because I wanted to do what you have done and write a nice thin C++ layer over the C socket APIs, so it's abstracted for modern C++ developers without having to worry ...
Matt Conway's user avatar
3 votes
Accepted

C - Client Server application

Welcome to Code Review, a very nice first question. I commend you for the ability to be able to debug rather complex code. Just a few observations to help out: Bug in the Code Since the while(1) ...
pacmaninbw's user avatar
  • 24.8k
3 votes
Accepted

Handling Server Responses

You don't show enough code to give you accurate advice on design. But from what I can see, LoginAction class has a bunch of problems: 1) It has two huge static ...
Nikita B's user avatar
  • 13k
3 votes

CloudFlare Dynamic DNS Update Script in Python 3

# Horribly unnecessary wrapper You're right. Don't write your own exit. Since exit itself ...
Reinderien's user avatar
  • 65.2k
3 votes

PHP script that writes a JSON file with iextrading API data

You cannot use a return in a __construct() method. If you need to check for any "badness", you can use ...
mickmackusa's user avatar
  • 8,694
3 votes

HTTP C++ Implementation

Let me add a few quick comments to the other review(s). In general, pay attention to const correctness to reduce the chances of making mistakes and also to avoid unnecessary - and potentially ...
Juho's user avatar
  • 3,589
3 votes
Accepted

C++ Crypto: Part 1- Hash

Proper capitalization of SHA1 The algorithm's name is SHA1, not Sha1, so I think it is better to use all caps here. That makes grepping the code for a particular algorithm easier. You only need one ...
G. Sliepen's user avatar
  • 61.7k
3 votes
Accepted

Simple command line API client for getting quotes

One way to improve the structure would be to modularize your code. Once your client is a "real" module, you can convert your main.py into a ...
Reinderien's user avatar
  • 65.2k
3 votes

API client to retrieve traffic news

CLI-program feedback You have used argparse. This is ok, but very basic. There are at least two options that are way easier to read and write: typer and click. Click comes from the Flask ecosystem and ...
Martin Thoma's user avatar
  • 1,245
3 votes
Accepted

API client that builds a response over multiple lines

By using any you are losing type safety, which defeats the point of Typescript, at least in this spot. But sometimes it’s just easier. Just because the example is ...
Dave Meehan's user avatar
3 votes
Accepted

The receive function for telnet client

Error handling You are already doing a lot of error handling, which is good, but you need to pay a little bit more attention to what kind of errors functions can return, and how to respond to them. ...
G. Sliepen's user avatar
  • 61.7k
2 votes

Handling Server Responses

It is not about the specific code being written but I think it probably should too because one part that you left there is very suspicious. ...
t3chb0t's user avatar
  • 44.3k
2 votes
Accepted

Get application credentials from linked array obtained from Cloud Foundry API

Consider breaking this into more, reusable methods. E.g. ...
mdfst13's user avatar
  • 21.7k

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