Skip to main content
9 votes

Rotary Encoder Controller C++

In addition to what J_H already mentioned: UDP is not reliable UDP does not guarantee that if a message is sent, that it will be received exactly once by the other side. Sometimes that's fine; if you ...
G. Sliepen's user avatar
  • 69.3k
9 votes

Rotary Encoder Controller C++

magic number I think that MAXLINE dictates your buffer size, and that for parallel construction with the recv() we wanted sizeof(buffer) here: ...
J_H's user avatar
  • 42.3k
6 votes

Send arbitrary number of arbitrary length buffers in packets of fixed arbitrary size

More functions please. Every time you feel compelled to put a comment like // Fill packet with payloads you admit that you fail to express yourself clearly in ...
vnp's user avatar
  • 58.7k
6 votes

Send arbitrary number of arbitrary length buffers in packets of fixed arbitrary size

contract There's no Doxygen or other comments, so the signature is being asked to do some heavy lifting for the documentation: ...
J_H's user avatar
  • 42.3k
5 votes
Accepted

UDP Reverse Shell

UDP is not reliable. The packet sent to the sever could be lost (and therefore the server will not answer). The packet sent by the server could be lost. The client must handle such possibilities. As ...
vnp's user avatar
  • 58.7k
5 votes

UDP Reverse Shell

General style Your general code style is good. The methods are named feasibly and you stick to PEP 8. Separate client and server shutdown Currently your "quit" ...
Richard Neumann's user avatar
4 votes
Accepted

Simple UDP server (java)

General Classes should be final unless you intend and have designed them to be extended. Marking local variables as final will ...
Eric Stein's user avatar
  • 6,726
4 votes
Accepted

Non-blocking TCP and UDP in Unity3D Game Engine

General From the code that you posted it looks like you are creating a client for every message that you are sending, this isn't very common behavior. Unless there is a specific reason i would expect ...
Harald Scheirich's user avatar
3 votes

UDP and TCP sockets in the browser

Your logging to console should be in a function with a log level. The final code should not write that much to the console. Setting nuls looks like copy-pasted code, you could consider encapsulating ...
konijn's user avatar
  • 34.4k
3 votes

Game-oriented UDP protocol

Even the question is so what out dated here some things I see on your code Copy Assignments You should remove the = on lines like ...
Finkman's user avatar
  • 31
3 votes

Gossip algorithm in distributed systems

Outside of refining the documentation - docstrings, comments, and type hints - I'd suggest: Improving input and output Some of your prints seem more suitable for a logger (...
ades's user avatar
  • 1,391
3 votes

Gossip algorithm in distributed systems

I've edited the code you wrote above to make it such that the nodes would continue to listen and broadcast messages even after the first message. I don't know if it was intentional, but it seems that ...
FedeCuci's user avatar
3 votes

Utility that decodes and logs UDP packets

Regarding the first part of it: From reading the golang docs, it appears buf := make([]byte, 36) //BUG? This causes ReadFromUDP to block = GOOD may work because ...
M. Cooperman's user avatar
3 votes
Accepted

UDP image livestream from Android device to C# desktop application

I have no experience with Kotlin, so I'll purely be focusing on the C# part Empty #regions: Delete them, they just take up unnecessary space. In the same vein, I ...
MindSwipe's user avatar
  • 235
3 votes

Send arbitrary number of arbitrary length buffers in packets of fixed arbitrary size

I see a number of things that may help you improve your code. Tell the compiler which sendmsg The code for udp_socket::sendmsg() ...
Edward's user avatar
  • 67.2k
2 votes

to capture packets with options like -i interface, -o open file, etc using pyshark and python

Nice, I'm glad you use pyshark so much that it's useful to customize it a bit. High level advice: Use functions! Everything here is at module level, and we could reduce global variable coupling by ...
J_H's user avatar
  • 42.3k
2 votes

Network IP packet tracker

I would rename IPPacket to PacketParser, and then create an IPacketParser interface that ...
John von No Man's user avatar
2 votes

Java UDP port knocking authentication. Many clients at the same time

I'm not going to look at the code for what is does, but I can give you some feedback on how it looks / is styled, and where you might improve. Exception handling Your current exception handling ...
Rob Audenaerde's user avatar
2 votes

ESP32-12: Sample analog audio and send it via udp

Fun project! power draw The arduino event loop is one level up, repeatedly calling into your loop(). I hope it occasionally does a brief sleep, to conserve ...
J_H's user avatar
  • 42.3k
1 vote

Rotary Encoder Controller C++

I revised the code of the client quite a bit; apart from the obvious (documentation, error checking, some formal issues) the main improvement is in the threads run-method: instead of calling ...
herrgross's user avatar
1 vote

Network IP packet tracker

I improved my code and now I made console application for tracking IP packets. I tracked IP packets with Wireshark and got same result. IPPacket class now contains IPHeader and ProtocolHeader data. ...
TJacken's user avatar
  • 291
1 vote
Accepted

NTP client displaying reference, originate, receive and transmit timestamps periodically with graceful shutdown in C#

Here are my observations DisplayNtpServerResponsePeriodically 0b00011011: I would suggest to move such magic number into a <...
Peter Csala's user avatar
  • 10.8k
1 vote

A send and receive UDP node in C

Does the code below satisfy this (?) Small review: minor issues. if (len + 1 > BUF_SIZE) { looks off-by-1, in a bad direction. I'd expect ...
chux's user avatar
  • 36.4k

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