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 ...
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 ...
5
votes
Handling Server Responses
Having bool Succeeded, bool Failed and bool Errored as members of the ...
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.
<...
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 ...
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 ...
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 ...
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 ...
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:
...
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 ...
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 ...
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 ...
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 ...
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/...
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:
...
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 ...
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 ...
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 ...
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) ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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.
...
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.
...
2
votes
Accepted
Get application credentials from linked array obtained from Cloud Foundry API
Consider breaking this into more, reusable methods. E.g.
...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
client × 108server × 49
c# × 27
socket × 21
java × 20
python × 19
c++ × 13
tcp × 13
api × 11
networking × 11
c × 10
json × 9
http × 9
python-3.x × 7
beginner × 6
object-oriented × 6
rest × 6
chat × 6
multithreading × 5
asynchronous × 5
android × 4
cryptography × 4
authentication × 4
javascript × 3
php × 3