8
votes
A remote trading bot that runs on the CLI - first C++ project
The API class:
There are two things I would change here.
1: Use the command pattern.
2: Don't pass strings around as actions.
The Command pattern
This is basically where you set up a container with a ...
7
votes
A remote trading bot that runs on the CLI - first C++ project
Looking at the "Password" class.
You are using the singleton pattern. But not well.
This:
...
6
votes
Accepted
Cardshifter chat lobby using vanilla JS
Quick skimming
let addChatMessage;
Why is this outside your lobbyController?
...
6
votes
Accepted
Cardshifter login page using vanilla JavaScript
Very neat project! I really like that you are avoiding using a library, it's a great way to get better at JS.
I see the if (DEBUG) { logDebugMessage() } pattern ...
6
votes
Accepted
Node websockets
In node, throwing an error without catching it will kill the process. This seems to be the primary error handling mode (and based on this it seems you then rely on pm2 to restart the process). This ...
5
votes
A remote trading bot that runs on the CLI - first C++ project
Looking the namespace Utils.
Code Review
...
4
votes
API Generator for Python
working on my titulation project
Mi lengua materna es el ingles,
but I'm afraid I don't know what the verb "to titulate" is all about.
Nonetheless, I welcome you with open arms to our ...
4
votes
Accepted
How to structure in handling websocket and inserting data to databse in Python
I find it unlikely this program works as expected. You have written approximately:
Open a database connection, & assign that to client
Get ...
4
votes
Monitor activity on a network
using namespace std;
Standard advice is to avoid depriving yourself of the benefits of the std namespace like this. Prefer to ...
3
votes
Handling more websocket connections
This is the same approach you used, just rewritten as a oop approach per pacmaninbw with a class socketConn inheriting from ...
3
votes
Accepted
Handling more websocket connections
Welcome to code review community. Few initial thoughts, when writing python code; following PEP-8 style guide makes your code more maintainable. Which would amount to (but not limited to):
Functions ...
3
votes
Accepted
Python WebSocket Server + SQLite + Multiprocessing
Imports
os is unused, you may want to remove it. ntpath is the specific implementation of ...
3
votes
Using async websockets in Rust with tokio, rmp-serde and varint encoding
First of all, kudos to using cargo fmt. It makes for an easy read.
Use clippy
If you're not doing it yet, I suggest you use ...
3
votes
Accepted
Encrypted websocket chat using AES (EAX) and RSA for signing
The protocol is already much better than the previous version where the server knew about all the keys. However, there are some weird things happening:
both a private key and a password is used; this ...
2
votes
Accepted
utility for automatic websocket ping-pong and receiving round-trip time reports
as I may be biased by the specific use-cases I was dealing with, so a broader perspective ...
This is a wonderful remark, thank you for sharing.
There's always more for each of us to see.
magic ...
2
votes
Accepted
Encryption implementation for websocket chat (RSA + AES)
Is this a good implementation for encryption in a chat?
No.
I'd argue that most chat implementations are not dependent on the server to decrypt / reencrypt the information (this is called a proxy in ...
2
votes
Accepted
Golang WebSocket communication between server and app
You've reviewed your own code, and done a good job, actually:
...
2
votes
Electron Application with JavaScript Backdoor and Ruby Command-Line Listener
Bearing in mind that this comes a couple years late and you (the OP) haven't logged in since 9/ 2016, it might not be seen for some time. Also, I don't really have much ruby experience so I will ...
2
votes
Websockets client code and making it production-ready
The wrapper sends and receives exactly one message before closing the connection. If you're just doing that, you can simply use HTTP. WebSockets is useful when there is a sequences of reads and/or ...
2
votes
Updating state with React and Websockets
This seems reasonable. The most important part is that you do not mutate the react state in-place. By doing let currentUser = [...users]; you copy the state and ...
2
votes
Accepted
General web socket client with auto reconnect capabilities
Here are my observations
DeribitClient
SubscribeToDeribitPriceIndexAsync
The re-creation of the ...
1
vote
Simple websocket chat app, security and efficiency concerns
There is no direct input into that line, but can't they just open console and go execute that function themselves?
Yes, but if I was a malicious actor, I would just take your websocket url and build ...
1
vote
Adding websocket functionality to send live data from a Python script. Any edge-cases or unexpected consequences to beware of?
I'm not familiar with how websocket works, but from your code I think I can infer it. So here a few comments:
It seems your subscribers list depends on currently ...
1
vote
Accepted
Private desktop and mobile WebSocket connections with Node.js
The code you made is looking pretty good. I'm no expert in the particular tools you're using, but I'll still give my two cents about the parts I understand more.
Let's start with your upgrade listener....
1
vote
Node.js ws server: global or local functions?
"Before going too far" - is the tip of the iceberg as I see it :)
If it's just a simple lab, nothing fancy, tutorial for the sake of testing some functionality and everything should remain small and ...
1
vote
Accepted
Spring Boot Websocket STOMP Crud
@Autowired is not required on constructor in Spring over 4.3 (class has to be annotated as bean and have only one constructor).
Inject ...
1
vote
Handling several types of messages over a web socket connection
Any part of the code that understand how the data is fetched or how the data is structured is considered Model
You could make a WebSocketController that accepts a <...
1
vote
Accepted
WebSocket API that connects to ASP.NET Core Backend
Class
You have to implement IDisposable (assuming _webSocket type is derived from WebSocket ...
1
vote
Accepted
Java websocket class
A few ideas:
First of all, I think splitting your class into several classes is a good idea. As I admittedly do not fully grasp the business logic, this is more or less up to you, but basically have ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
websocket × 58javascript × 20
python × 15
node.js × 12
c# × 7
c++ × 5
java × 4
beginner × 4
asynchronous × 4
async-await × 4
performance × 3
python-3.x × 3
go × 3
api × 3
stackexchange × 3
asp.net-core × 3
chat × 3
game × 2
ecmascript-6 × 2
react.js × 2
cryptography × 2
stream × 2
spring × 2
sqlite × 2
socket.io × 2