An endpoint of a bidirectional inter-process communication flow. This often refers to a process flow over a network connection, but by no means is limited to such.
3
votes
1answer
28 views
Optimizing a Node.io server code for self-balancing robot
I am building a 3D printed self-balancing robot, and use the attached server script to control it. I coded using node.io, express and socket.io.
The system is working, but I would appreciate some ...
7
votes
2answers
54 views
Mimicing a TCP connection
I've recently started a new job and been drafted on to a project that's running late. My task was initially to add Bluetooth connectivity to a C# app, but at the request of a more senior colleague ...
2
votes
2answers
63 views
Mutual friends finder written in Python
I've written a server/client tool which can "check the Six degrees of separation theory" in Russian social network VK.com. Client sends task (which contains two VK IDs) and Server tries to find all ...
6
votes
1answer
114 views
How do I interrupt a ServerSocket#accept() and shut down a multi-threaded socket server?
I have got here a work-in-progress piece of code here that does multi threaded communication via sockets. I am using a poison pill to shut it down. It is a local port number. Is there a better way to ...
3
votes
1answer
54 views
Refactoring this producer consumer class to minimize what is exposed
I don't like the service class below, specifically, the way it exposes the internals of the producer. While it would be possible to combine all three classes into one producer-consumer, I would ...
6
votes
1answer
126 views
Simple chat console app
I wanted to practice using sockets and multithreading. This is simple code where I start a Server and connect to it via Client ...
2
votes
3answers
266 views
Adding a timeout to an UDP socket server
I use a thread to read from a UDP socket. Afterwards the string gets parsed.
In another thread I send to every connected client via this socket. I would like to keep latency and resources for running ...
6
votes
3answers
194 views
Read partial socket message
I've written some code that is suppose to read socket all the time and when needed return the partial data from it. I just want the response to send a command. It works, but this is a bit messy ...
0
votes
2answers
133 views
Python UDP-server and JSON parser script
I am a python beginner. I wrote a script which should run on a raspberry PI as an UDP server. It is reading and writing to a serial device and has to process and forward JSON strings too.
Because ...
2
votes
4answers
361 views
Silent Try_catch in high load socket server or not?
I'm working on a socket application that will listen to incoming messages from about 400 devices. They all send a message at least once per minute. Now I have a working program and it has been running ...
2
votes
1answer
62 views
Proxy using socket, doubts on multithreading and connection closing
I'm trying to make a simple proxy server in Python using the socket library, mostly to understand how it works. I'm a noob both at programming and networking, so please be nice if my questions are ...
5
votes
1answer
370 views
Socket HTTP post request
I am working on a socket HTTP post request. Here is one method that I come up with. It looks dirty and is in C instead of C++.
...
5
votes
1answer
320 views
Multi-threaded socket server high load
I'm trying to make a backend for QuizUp like application: user connects to a server, sends credentials and gets paired up with another user. After that server handles each pair, periodicaly sending ...
6
votes
2answers
143 views
Keeping track of byte count in a binary protocol handler
I am putting together a fairly simple server that listens for a connection then creates this thread - textbook Java code - then accepts data on that connection.
I am following a protocol that the ...
6
votes
2answers
332 views
Echo server with CompletableFuture
I recently wrote a simple echo server in Java 7 using the NIO APIs so it was asynchronous and non-blocking. Then I decided, as a learning experience, to redo it with Java 8 hoping to use a more ...
7
votes
4answers
106 views
13
votes
1answer
263 views
First socket class
I want my socket class to be reviewed, including recommendations and optimizations.
Sokect.hpp
...
5
votes
2answers
167 views
Socket class for use in web server
I've created this socket class to use in my web server application. I have two classes: one for the socket and the other for the webserver.
...
6
votes
1answer
221 views
Checking web-page repeatedly
I have a program that gets 5 random dice throws from random.org over and over. In order to avoid doing getaddrinfo() over and over with the exact same data, I moved ...
7
votes
1answer
587 views
Multi-threaded server socket
I'm somewhat new to network programming. I have a server that uses Ubuntu, which needs to send data quickly to about 50 clients.
As of now, I have about 50 concurrent connections (of course), and it ...
5
votes
3answers
4k views
Client/server implementation in C (sending data/files)
I wrote this code to send any binary file from server to client (in our example, I am sending sample_file.txt); the client should recreate the file locally.
Code works fine (I tested with one or two ...
10
votes
3answers
162 views
Windows socket class
I need some advice to see if my simple Windows socket class is good enough to be used in a simple chat application.
...
3
votes
1answer
559 views
Run a TCP server listening for incoming messages
I've written the following code, but I need some review on design style. I want to develop a library/module and expose an API to client programs. How do I do that?
The code just runs a TCP server ...
4
votes
0answers
148 views
A polling wrapper for Python's socket library
Even though I am working with one socket, I have wrapped it with an object which allows .recv() method which accepts timeout, using Python's ...
20
votes
3answers
2k views
Java method - levels of abstraction
In his Clean Code book, Robert C. Martin states that functions should do only one thing and one should not mix different levels of abstraction. So I started wondering whether the code below meets ...
8
votes
1answer
180 views
HTTP Stream Part 2 A stream that opens an HTTP GET and then acts like a normal C++ istream
The review I asked for yesterday was for a header only library.
HTTP Stream A stream that opens an HTTP GET and then acts like a normal C++ istream
This has some limitations as it downloads all the ...
4
votes
1answer
239 views
Turning a Java console app into a server
I'm not familiar with Java at all, so I'd like to get some feedback on this piece of code.
I made it by looking at a few Hello World-esque Java server examples, so it may have drawbacks I'm not ...
3
votes
2answers
1k views
Python Port Scanner
This is only my third Python script. Be brutal with me. Any tips, tricks, best practices, or better usages would be great!
...
11
votes
1answer
305 views
Stream that opens an HTTP GET and then acts like a normal C++ istream
Needed a quick stream to get JSON objects.
...
0
votes
0answers
148 views
Socket.io listener with many categorized events
I wrote a web application in a RHOK event, and I want to know if I did it in the best possible way.
My question is about my server side code; each client that connects goes through this:
...
1
vote
1answer
147 views
C: File locking between server threads
I have written below code where the server is getting requests from clients on socket and creating a thread per client. Each client thread is then writing to a file which is common to all the threads. ...
3
votes
2answers
2k views
Review of “is port in use?”
Review this code. It should return true if a port is in use, false if the port is not in use. Clarification : "In use" means ...
5
votes
1answer
2k views
Performant C# Socket server
I am creating a performant C# socket server. I'd like it to be able to accept as many simultaneous connections as possible. I've tested with 100 clients and all clients are fine. With 1000 however, ...
2
votes
1answer
74 views
Extract location from HTTP socket
I have the following HTTP reply saved in a local file called source.txt:
...
1
vote
1answer
123 views
2
votes
3answers
1k views
Detecting socket disconnect in .NET
First off, I know there are other solutions and practices but I'm referring to MS proposed code from .NET documentation.
It goes like this:
...
4
votes
1answer
269 views
Transfer log file between client and server while updating files automatically
All this code does is transfer the files. In order to make changes to the file, one has to re-transfer the file. During this time, I stand by to automate the update operation, where the server ...
2
votes
1answer
185 views
Proper cleanup in multithreaded client/server code
For a university project I'm trying to build a system that has a general architecture of:
Client app <=====> Client library < - - > Server library <=====> Server app
I'm trying to make the ...
6
votes
2answers
10k views
C# Console Chat Server - Async/Await, TcpClient/TcpListener, NetworkStream (async)
Just looking for feedback on correctness of my understanding of async/await.
Curious about the Task.Run inside of the StartReceive() method. Resharper (or maybe just the compiler) warns against ...
2
votes
4answers
279 views
if-elseif chain. Is there a better pattern?
I'm working on a TCP Server using .NET and the following code is my first attempt to process the received data (from the socket) to create a packet to deliver. Basically, the packet has a header (7 ...
0
votes
1answer
2k views
Stuck with Multi-Client Chat Application
I'm trying to make a MultiClient Chat Application in which the chat is implemented in the client window. I've tried server and client code for the same. I've got two problems:
A. I believe the code ...
1
vote
1answer
745 views
1
vote
0answers
801 views
Transmitting/Sending big packet safely using TcpClient/Socket
I am writing a TCP based client that need to send and receive data. I have used the Asynchronous Programming Model (APM) provided for Socket class by the .NET ...
3
votes
1answer
4k views
Reusing thread and UdpClient for sending and receiving on same port
The working and functional code below is a simplification of a real test application I've written. It acts as a client which asynchronously sends UDP data from a local endpoint and listens for an ...
2
votes
2answers
278 views
How is this for a “Hello World” of socket programming?
I was trying out the Beej's guide to socket Programming and wrote this. Is there anything that I am obviously doing wrong? Any potential for buffer overflows? Segmentation faults? Any possible errors ...
2
votes
1answer
364 views
RTCPeerConnection signaling library
I created a library/npm module to handle the signaling process for RTCPeerConnection. There is still a good bit of work that needs done (error handling, dealing ...
5
votes
2answers
10k views
TCP async socket server client communication
I develop my first async TCP socket server and client program in c# and would like to review the first parts of it. I like to get some information’s about smelly code that I missed and what I could ...
3
votes
1answer
113 views
Communication with GARMIN through WEB
I am developing a WEB based GPS system and one of its functionalities is to be able to send messages and routes to GARMIN devices.
I have never been using sockets before, and for some (obvious) ...
2
votes
0answers
506 views
Join / leave source-specific multicast group and connect / disconnect corresponding socket
I need to join source-specific multicast group and receive data. When I don't need to receive data anymore, I need to leave the group and disconnect the socket.
Am I doing everything right? In ...
5
votes
1answer
543 views
Socket handling in a thread
I am building an app for android to control VLC (mediaplayer) that runs on my computer.
At the moment it's just a prototype that works, but I was wondering if I am correctly managing my HandlerThread ...