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 ...
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:
...
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 ...
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:
...
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 ...
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" ...
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 ...
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 ...
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 ...
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
...
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 (...
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 ...
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 ...
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 ...
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() ...
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 ...
2
votes
Network IP packet tracker
I would rename IPPacket to PacketParser, and then create an IPacketParser interface that ...
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 ...
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 ...
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 ...
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.
...
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 <...
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 ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
udp × 38python × 10
networking × 10
c# × 8
socket × 7
c++ × 6
server × 6
java × 4
performance × 4
multithreading × 4
tcp × 4
go × 3
beginner × 2
python-3.x × 2
algorithm × 2
c × 2
.net × 2
asynchronous × 2
logging × 2
audio × 2
pthreads × 2
javascript × 1
array × 1
game × 1
ruby × 1