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

21
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 ...
13
votes
5answers
783 views

Raw Text TCP Client

Yesterday I posted a request for a code review. After reviewing the code and the reviews, and after some sleep, I decided I can do better. In fact I logged on with the intent of deleting the question ...
13
votes
1answer
376 views

First socket class

I want my socket class to be reviewed, including recommendations and optimizations. Sokect.hpp ...
13
votes
1answer
122 views

TCP Socket Wrapper

I'm trying to build a simple server software for training purpose, most likely a IRC server, but I'm not there yet. I'm currently implementing a TCP socket class, to ease the use of the C socket API. ...
12
votes
1answer
525 views

Stream that opens an HTTP GET and then acts like a normal C++ istream

Needed a quick stream to get JSON objects. ...
11
votes
4answers
21k 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: ...
11
votes
2answers
64 views

Raw Text TCP Client v3

After studying and considering the reviews for this code, I began working on the code, and came up with this. It has much better error and disconnect detection, and it also resolves addresses: ...
10
votes
3answers
428 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. ...
10
votes
4answers
102 views

Impromptu TCP sender/receiver

Every once in a while I need to get some random computer thing done; so I write something to do it for me. This is one of those. It needed to be able to send text to, and receive text from, a server - ...
9
votes
1answer
19k views

Java multi-thread file server and client

My task was to build a multi-thread file server and a client that can upload or download a named file over sockets. It is assumed that the client will finish after its operation and there is no need ...
8
votes
3answers
24k 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 ...
8
votes
2answers
13k views

Console chat server

I'm just looking for feedback on correctness of my understanding of async/await. I'm curious about the Task.Run inside of the ...
8
votes
2answers
312 views

Sockets and networking for a multi-platform game

I'm in the process of adding network support for a little Mac & Windows game I'm writing. Today I've finished the basic sockets plus a few other network helpers and would appreciate having the ...
8
votes
1answer
5k 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 ...
8
votes
2answers
2k 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 ...
8
votes
1answer
256 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 ...
8
votes
1answer
456 views

A program to proxy MDNS requests to the DNS server

I wrote a program to proxy MDNS requests in a local network to the DNS server. This is useful because in some private networks, host names ending in ".local" are configured in the DNS server. But ...
7
votes
6answers
764 views

Reading a line of text from a socket

I tend to write code, with very few comments, and few line breaks. I'm currently just a student at a University. I've had professors tell me one way or another to comment, but I have a hard time with ...
7
votes
2answers
326 views

TCP socket retry mechanism

I am writing a C++ client application which will send some data to server and wait for its response. Now the protocol is to wait for a specific timeout and then retry for specific times. If all goes ...
7
votes
2answers
433 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 ...
7
votes
1answer
517 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 ...
7
votes
1answer
109 views

Simple C Port Scanner

I have been writing a Simple Port scanner in C, once I got it to work I decided I wanted to make it faster because it takes a very long time for it to get done with scanning all of the ports.Is there ...
7
votes
1answer
59 views

Python Socket Receiver

I put this together and am having some doubts to the number of connections I can make. I also doubt if I can brute force the server to serve up connections and then hang. Please take a look and tell ...
7
votes
1answer
823 views

Custom TCP Java proxy socket load balancer

I'm working on implementing a custom TCP proxy server which acts like a load balancer. The proxy server will accept client requests and then forward them to available hosts. I am concerned about the ...
7
votes
1answer
84 views

Dictionary synonym lookup via networking

I have a small TCP service running on port 4444 which, given a word, will look up synonyms in a dictionary. Below is my Scala code for connecting to the socket, sending the lookup command and parsing ...
6
votes
4answers
152 views

Optimize RecvData wrapper

How can I improve the string RecvData() function? ...
6
votes
2answers
25k 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 ...
6
votes
3answers
414 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 ...
6
votes
1answer
185 views

C Socket API Call with Swift

I have a small function in Objective-C which uses the C Socket API to check if the device has an active internet connection: ...
6
votes
1answer
239 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
8k 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 ...
6
votes
2answers
88 views

Multithreaded Network Server

I would like the following code reviewed: I am trying to create a local server which listens indefinitely and provides the latest information. The server runs another while loop which fetches ...
6
votes
2answers
221 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
1answer
2k 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
1answer
4k 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, ...
6
votes
1answer
2k views

Interrupting a ServerSocket#accept() and shutting down a multi-threaded socket server

I have some code in progress 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 shut it down gracefully? ...
5
votes
1answer
314 views

Multithreaded client server socket

I have created this library mostly for a learning experience with sockets and threading. For this review, focus on socket/threading. Let me know if I properly implemented both. If you want to comment ...
5
votes
2answers
260 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. ...
5
votes
1answer
110 views

Java NIO Server Scaling

I wrote a Java NIO Echo Server and want to maximize the number of connections to the server. The problem is that when I try to connect more than 10k clients the clients get their connections refused: ...
5
votes
2answers
70 views

Scanning for open ports

I made what started out as a web browser but now is a scanner for open ports. I wanted to know if you think this is a realistic or a unreliable tool for port testing. I found some open ports on my ...
5
votes
1answer
1k 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
2answers
11k views

Asynchronous Sockets

I need to implement a TCP client application. The client and the server send messages to each other. I want to make this program scalable enough to handle connections to multiple servers at the same ...
5
votes
1answer
4k 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
2k 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) ...
5
votes
2answers
444 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
3answers
67 views

Fetching filesystem directory listings on a server

I developed a server which takes a directory name then lists files in it and sends this list to a client. And I want that server to work with Telnet. It works but I have some questions on how I can ...
4
votes
2answers
4k 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! ...
4
votes
1answer
2k 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 ...
4
votes
1answer
2k views

Creating a TCP Listener and receiving data

I am very new to network programming and I'm thinking I have probably misconstrued the creation of an appropriate TCP listener. The code I have below works perfectly, but I have a feeling it's a "hack ...
4
votes
1answer
185 views

Web socket server which needs to query some API and to pass chunk per chunk of data to its socket clients every M seconds

Let's say that I want to query some API which will respond with array of random numbers: [4, ..., 17, ..., 25] To keep things simple enough, let's say that array has always 10 elements. For ...