Hot answers tagged

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
14 votes
Accepted

HTTP request and HTTP client abstractions

Code Review A standard naming convention (if there can be said to be one). Is that user defined types start with an initial capitol letter. Other identifiers that name objects (or functions) start ...
Martin York's user avatar
  • 94.6k
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
Accepted

Semi-primitive IRC bot serving as learning project

One of the key points in having readable and maintainable code is to have consistence of the choosen style which isn't the case in your code. You have different indention styles for methods. ...
Heslacher's user avatar
  • 50.4k
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

Semi-primitive IRC bot serving as learning project

I'm not a C# expert, so I'll try my best to give a good review: ...
Quill's user avatar
  • 11.9k
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

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

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
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
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
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

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

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

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.1k
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,778
4 votes
Accepted

Simple Go TCP server and client

Your reverse, and swapCase functions are good. The native use of runes is great, and the functions are clear, etc. If I was to ...
rolfl's user avatar
  • 97.3k
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.2k
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
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
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

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
  • 5,864
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
  • 60.5k
4 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
  • 23.8k
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.6k
3 votes
Accepted

Telegram - GetUpdates Process

Disposable You class manages a Timer, which you dispose of if Terminate is called. It feels like your class should implement <...
forsvarir's user avatar
  • 11.6k
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
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
  • 23.8k
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

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