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 ...
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-...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
10
votes
Accepted
Network Interface Object
There is no guarantee that write writes out the entire buffer. This means that
...
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 ...
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 ...
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 ...
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 ...
10
votes
struct sockaddr_storage initialization by network format string
Use getaddrinfo()
Instead of using inet_ntoa(), getservbyent() and similar low-level ...
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
...
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. ...
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 ...
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 ...
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 ...
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 ...
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 ...
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, ...
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
...
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:
...
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 ...
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 ...
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 ...
7
votes
Accepted
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
networking × 356python × 85
c# × 66
socket × 50
java × 48
c++ × 45
multithreading × 34
c × 32
tcp × 31
python-3.x × 27
linux × 26
performance × 20
beginner × 20
server × 17
bash × 16
.net × 15
python-2.x × 14
ip-address × 14
windows × 11
client × 11
status-monitoring × 11
udp × 11
object-oriented × 10
http × 10
security × 9