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
  • 41.1k
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,416
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
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
  • 61.7k
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
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
  • 112k
10 votes
Accepted

Network Interface Object

There is no guarantee that write writes out the entire buffer. This means that ...
vnp's user avatar
  • 57.3k
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,828
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
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,777
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
  • 61.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
  • 81.7k
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
  • 61.7k
9 votes
Accepted

A TCP server which uses one thread to read while writing data with another thread

It's perfectly ok to read and write a socket from two threads at the same time. You don't need to mutex anything, just have one thread read and one thread write. But if the point of the program was ...
Guntram Blohm's user avatar
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.2k
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
  • 81.7k
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
  • 24.8k
7 votes

Multithreaded C# TCP Socket Server

I am kinda new to reviewing code but I know c# kind good and will try my best. First, let's go over some code style issues. At the top you declared variables like this: ...
Patrick Hollweck's user avatar
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
7 votes

Implementation of portscanner for a host

Use getaddrinfo only once, to resolve the host. Do the port number iteration directly yourself. While it might be more complicated, it also doesn't call for repeated hostname resolutions. This also ...
David G.'s user avatar
  • 1,461
7 votes
Accepted

Implementation of portscanner for a host

Here are some things that may help you improve your program. Use only required #includes The code uses nothing from ...
Edward's user avatar
  • 66.6k
7 votes
Accepted

Network utility tool

Nicely formatted comando[] deserves a greater size ...
chux's user avatar
  • 33.6k

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