Skip to main content
52 votes

Send a tweet to ISP when internet speed drops

Overall this is quite a nice module. Here are a few usability issues/nitpicks, though: When running the script, there is no easy way to stop it. CTRL+C does not work, I have to manually kill the ...
Graipher's user avatar
  • 41k
37 votes

Send a tweet to ISP when internet speed drops

This is more of a design / algorithm / architecture review than of the code. There are some major issues the other answers didn't address. First of all, wasting network bandwidth running a speed-...
Peter Cordes's user avatar
  • 3,346
30 votes
Accepted

Simple and effective port checker in C++

Checking TCP ports and multi-threading Your performance should be fine for a sequential program. Another way to check whether the TCP port is open is by just sending the initial ...
Zeta's user avatar
  • 19.3k
25 votes

Send a tweet to ISP when internet speed drops

I'd like to say just one (yet IMO very important) thing: You're developing bad habits early! The point of classes is to eliminate (truly) global state and to ...
Grajdeanu Alex's user avatar
15 votes
Accepted

Python internet speed testing

Concept Internet "speed" actually consists of multiple factors, including bandwidth, latency, and packet loss. What exactly are you trying to measure? If it's bandwidth (data transfer speed in bits ...
200_success's user avatar
14 votes
Accepted

Porting C-style socket to CPP class

Avoid using malloc() in C++ There are much better ways to allocate memory in C++ that are simpler and safer. First, in C++ you should use ...
G. Sliepen's user avatar
  • 58.3k
13 votes
Accepted

Simple IRC Bot in C#

you should separate the IRCBot from the Main into its own class with it's own fields/properties you should specify all required ...
t3chb0t's user avatar
  • 44.3k
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
12 votes

Simple IRC Bot in C#

In addition to t3schb0t's answer I'd also change your parsing logic. Your code is just few lines and it's already too complicate to read. After you moved code into a separate class then it's time for ...
Adriano Repetti's user avatar
11 votes

Add and enable/disable Windows Firewall rules with Python

I agree with @Ludisposed answer, but you have a few subprocess gotchas: You don't need to spawn a shell in order to run the command, simply build your command as a ...
301_Moved_Permanently's user avatar
11 votes
Accepted

struct sockaddr_storage initialization by network format string

Am I using too many comments? No. Am I using too much register variables? Yes. The register keyword is completely obsolete these days. It was intended as an ...
Harith's user avatar
  • 9,150
10 votes
Accepted

Bob Marley is jamming on the wifi

Nothing would make a reviewer happier than help you jam the networks of an innocent neighborhood. (sarcasm) Mutually exclusive conditions Can line match ...
janos's user avatar
  • 111k
10 votes
Accepted

Network Interface Object

There is no guarantee that write writes out the entire buffer. This means that ...
vnp's user avatar
  • 56.6k
10 votes

Network Interface Object

the posted code causes the compiler to output several warning messages. When compiling, always enable the warnings, then fix those warnings. Here is the compile statement and the resulting warning ...
user3629249's user avatar
  • 2,818
10 votes
Accepted

Add and enable/disable Windows Firewall rules with Python

This seems OK We can add a little flavor to it: Don't use string concatenation, but use f"{strings}" or ...
Ludisposed's user avatar
  • 11.6k
10 votes
Accepted

Python scanner for the first free port in a range

Your code has some incorrect assumptions. an application may listen on a specific address/port combination; 127.0.0.1:port can be available while ...
Oh My Goodness's user avatar
10 votes

struct sockaddr_storage initialization by network format string

Use getaddrinfo() Instead of using inet_ntoa(), getservbyent() and similar low-level ...
G. Sliepen's user avatar
  • 58.3k
9 votes

Structure to ByteArray Extension

I haven't used it, however all of the documentation seems to suggest that you need explicitly free the memory allocated through: ...
forsvarir's user avatar
  • 11.7k
9 votes
Accepted

Multiplayer Peer-To-Peer position interpolation

I recommend you always write access modifiers for class members and for classes itself. It will make code more clear and understandable. So instead of ...
Maxim's user avatar
  • 2,542
9 votes
Accepted

Multiperson chat server using the select() API

log.h I don't think that calling code has any need for TS_BUF_LENGHT, so this could be moved to the implementation file. ...
Toby Speight's user avatar
  • 77.1k
9 votes
Accepted

Follow Up: struct sockaddr storage initialization by network format-string

Why not always use getaddrinfo()? I kept the version with struct sockaddr_storage anyway Why? It is inferior in every possible ...
G. Sliepen's user avatar
  • 58.3k
8 votes
Accepted

Robust websocket server for use by a game running on node

A bunch of small things: In .addNewClient(), you can change this: var time = new Date().getTime(); to this: ...
jfriend00's user avatar
  • 3,948
8 votes
Accepted

Wireless Rickroll using Arduino

No particular comment on the Arduino-specific or Wifi-specific stuff, but here: ...
Quuxplusone's user avatar
  • 19.4k
8 votes

Send a tweet to ISP when internet speed drops

I think you need to think your use cases through a bit. What should this do during an outage? Do you want to enqueue a new tweet if a previous one hasn't been sent yet? Do you want to enqueue a ...
SQB's user avatar
  • 226
8 votes
Accepted

Reading data from network stream

You should never throw an empty exception. Imagine someone uses your code and receives an empty IOException. What happened? How do you debug this? First, you need ...
IEatBagels's user avatar
  • 12.4k
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
8 votes

Follow Up: struct sockaddr storage initialization by network format-string

There's a subtle mistake in this macro definition: #define ARRAYSIZE(x) (sizeof(x) / sizeof(x[0])) When we put parens around the expansions of macro arguments, ...
Toby Speight's user avatar
  • 77.1k
7 votes

QNetworkReply network reply timeout helper

Here are my thoughts: It's a simple class that allocates quite a few times on the heap. You could minimize the number of implicit allocations it does. The ...
Kuba hasn't forgotten Monica's user avatar
7 votes
Accepted

Real time UDP packet decoder

Welcome to CodeReview. If you are going to permanently keep your debug code around then you might want to you might want to embed it within ifdefs such as ...
pacmaninbw's user avatar
  • 24k
7 votes

Update MediaWiki settings with dynamic IP address

That's nutty, trying to address a server by a changing IP address. Reconfiguring the wiki to adjust to it is even crazier. The standard practice for adapting to dynamic IP addresses is to use a ...
200_success's user avatar

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