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.

learn more… | top users | synonyms

3
votes
1answer
41 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
101 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
172 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
172 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
70 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
326 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
29 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 ...
4
votes
1answer
87 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
183 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 ...
5
votes
2answers
122 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
215 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
98 views

Optimize RecvData wrapper

How can I improve the string RecvData() function? ...
13
votes
1answer
249 views

First socket class

I want my socket class to be reviewed, including recommendations and optimizations. Sokect.hpp ...
5
votes
2answers
142 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
216 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 ...
6
votes
1answer
454 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
2k 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
137 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
425 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 ...
3
votes
0answers
100 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
165 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
196 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
959 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
272 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
122 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
126 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
1k 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
1k 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
73 views

Extract location from HTTP socket

I have the following HTTP reply saved in a local file called source.txt: ...
1
vote
1answer
114 views
2
votes
3answers
810 views

Is this good way to detect 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
208 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
181 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 ...
5
votes
2answers
8k 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
268 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
686 views

Multi-threaded socket client for Scrolls

https://github.com/david-torres/ScrollsSocketClient ...
1
vote
0answers
693 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
3k 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
258 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
330 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
8k 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
109 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
450 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
402 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 ...
5
votes
1answer
1k views

Simple Socket class hierarchy

One of the things I wanted to do was make it impossible to forget to initialise or forget to cleanup WSA. Often the network examples will return as soon as an error occurs (say an socket didn't bind) ...
2
votes
2answers
1k views

Asynchronous SSLSTREAM

Recently I have written an SslStream class asynchronously authenticate clients and receive message from them. I still would like anyone to suggest improvements for ...
6
votes
1answer
4k views

Stupidly simple TCP client/server

I'm trying to validate some results that I see when using NetPipe to test some connectivity between a couple of Linux boxes (over various hardware). So, I concocted this simple client and server to do ...
11
votes
4answers
16k views

TCP Socket Server

I've only been coding C# a few weeks and was just hoping for a little constructive criticism of a socket server I've been working on: ...