Skip to main content
Share Your Experience: Take the 2024 Developer Survey

Questions tagged [tcp]

Transmission Control Protocol (TCP) is a transport layer protocol that provides a connection-oriented data stream service with guaranteed, in-order delivery.

Filter by
Sorted by
Tagged with
4 votes
1 answer
84 views

Simple Redis implementation in Rust

This is a very tiny implementation of Rust that uses redis serialization protocol (RESP). I implemented it as one of code crafters challenges. I have less than a few month experience in Rust, so it ...
Amir reza Riahi's user avatar
3 votes
1 answer
101 views

simple multi-threaded TCP chatroom in Java

I'm fairly new at coding and looking to improve. Down below is all of my files for a TCP chatroom with a GUI in java. This is my first networking project so I'm sure it has many problems and does not ...
James Cowsert's user avatar
0 votes
1 answer
191 views

Why is this not considered better way than Async Await

After so many searches and back-and-forth attempts, I have developed an TCP Server to listen to the network stream and it is working fine. So kindly review the code, and please let me know if this ...
Ravi Kumar's user avatar
4 votes
2 answers
85 views

C++ Neuron Spike Raster Deserializer

Please help me establish a solid foundation for this computational neuroscience project. I'd like to make sure I'm moving forward with something reasonable before I begin tackling the more complex ...
Ders's user avatar
  • 43
3 votes
1 answer
116 views

Winsock code for lockstep RTS game

Summary This is my core networking code for the lockstep RTS game that I am creating. Clients connect to a relay server via a TCP socket, and any packets sent to the relay server are forwarded to all ...
Dan's user avatar
  • 341
1 vote
1 answer
226 views

to capture packets with options like -i interface, -o open file, etc using pyshark and python

review my code if possible. I am making network packet capture using pyshark and python. if possible give me some feedback about the code and help to make it better. ...
user20828450's user avatar
1 vote
3 answers
521 views

Improving a TCP communication between Python and C# programs

I have been using a TCP communications between Python and C# program. Python side (server) runs on a raspberry pi 4 and C# side (client) runs on my computer. RPi and PC connected over Wi-Fi. I have a ...
crackanddie's user avatar
3 votes
2 answers
2k views

TCP server in C++

I am building a TCP server in C++, and right now it's a test version without logic to handle server-client packet transactions. Please check if there are any memory leak related issues or anything ...
Asdfg Asdfg's user avatar
2 votes
0 answers
306 views

TCP&UDP Networking Library Design

Edit: This question is dead, so I am making an edit in hopes that someone who does have the time to look over my code sees it. If you have any way for me to improve this question/ask some other ...
Jakob Tinhofer's user avatar
0 votes
1 answer
1k views

TCP Server using Tokio

Solving the following problem on Protohackers: https://protohackers.com/problem/1 The problem: Each request is a single line containing a JSON object, terminated by a newline character ('\n', or ...
Rish's user avatar
  • 2,341
3 votes
2 answers
2k views

Multithreaded tcp server accepting two clients with task factory and graceful shutdown

as an exercise from multithreading and networking I have decided to create my own implementation of TCP server accepting connections from two clients (which is I think a pretty common case e.g. chess ...
Artur's user avatar
  • 169
1 vote
0 answers
653 views

TCP socket management using multiprocessing

I wrote a Python code for a device that generates an hotspot and communicates with an app using a TCP socket. The communication is managed by a process that opens a socket and uses two threads to send ...
firion's user avatar
  • 111
1 vote
0 answers
38 views

Wrap an ssh2 connection neatly and pass commands

I want to structure this better but don't think I'm handling results well. I'm used to python and I think my flow is way off. Is this bad design? Should my results be Result<String, Error>? I'm ...
shaciaran's user avatar
2 votes
1 answer
528 views

Resilient & Stable TCP Server Polling

I am looking for feedback to perfect my code developed for WPF in terms of speed, stability and resiliency. My code is supposed to handle synchronous status polling as well as asynchronous Commands to ...
Bilal Kazi's user avatar
1 vote
1 answer
156 views

simple code that tries to establish tcp handshake. Creating tun device | what ever ip packets message comes try sending valid response.checksum&TCP

So I am getting packets from TUN interface and after that processing the packet, and then try to send correct TCP handshake response message. It does handle sequence and ack sequence handling but That ...
user786's user avatar
  • 145
2 votes
0 answers
169 views

Asynchronous TCP server refactor design & not working features

I'm working on an asynchronous TCP server which is supposed to be used for a chat. I want to get a review for the TCP server part because I'm struggling to find a good design to fulfill the following ...
nop's user avatar
  • 729
3 votes
1 answer
213 views

Learning Sockets in C# (.Net Framework), Suggested Improvements?

I'm just learning how to allow interconnected apps via Sockets, watched a tutorial last night and based on that this is what I've gotten: Server.cs Code: ...
Austin's user avatar
  • 177
1 vote
2 answers
140 views

Low level tcp socket

Since I am a Unix newbie, I wanted to know if the code reflects the "unix" style and if there is something to add for it to be robust. P. S. I hope I am not overusing ...
Prakhar Srivastava's user avatar
1 vote
1 answer
358 views

Server hosting single page site using TCP sockets in C

I have written a simple server to host my page and CSS (CSS file is 22KB). Using sockets and TCP. Can any one please review it and give feedback on how can I make my server reliable using TCP and ...
user786's user avatar
  • 145
1 vote
1 answer
6k views

How to continiously read data from a NetworkStream

So I'm currently learning about networking between a client and a server and I decided to try to write my own client and server. I implemented a way of receiving data and it goes as follows.. The ...
RileyDan's user avatar
  • 123
2 votes
0 answers
370 views

Delphi TIdTCPClient connection pool in a multithread environment

I want to use TIdTCPClient to connect to Redis from a web server application made with Delphi and TWebModule. Currently on ...
ar099968's user avatar
  • 201
2 votes
1 answer
524 views

Network library based on boost::asio

I'm currently trying to develop an easy to use TCP networking library based on boost::asio. This is my first attempt to work with ...
Cian's user avatar
  • 21
4 votes
1 answer
2k views

TCP Multithreaded Server and Client C#

I created a TCP Server and Client and I really would like to know if its any good in regards of performance and code quality / safety. I hightlight the server and client class here. If you need more ...
HodorKing's user avatar
4 votes
2 answers
3k views

C++ sockets: Sending structs for P2P communication

Two parties communicate over a network sending back and forth up to 100 messages. Each message sent is a response to the last received message and depends on it. This means that both parties have to ...
Adomas Baliuka's user avatar
4 votes
2 answers
2k views

Simple TCP Client in C++

I've been experimenting with TCP clients in C++ and I really wanted to get some feedback on my code since I know it is bad. I would really appreciate some feedback on the class structure I have and ...
user avatar
0 votes
1 answer
155 views

A common class for Client and Server [closed]

I have written this code to use TcpClient both from a client program and a server program. Can you review this source code? Kindly, take a close look at ...
user366312's user avatar
2 votes
0 answers
186 views

Code to send print jobs through Jetdirect port

I have a program made in Go that lets me send files directly to printers through the Jetdirect port. The program works without issue and I can print in any printer with the port 9100 enabled. ...
JORGE's user avatar
  • 21
13 votes
3 answers
3k views

Correctly applying the "rule of five" to a RAII socket wrapper

I was trying to create a simple RAII wrapper with rule of 5 for a TCP POSIX socket. My aim was to try learn how to apply rule of five in different situations, but this one was somehow tricky. ...
Afshin's user avatar
  • 295
6 votes
1 answer
566 views

Read HTTP header from TCP socket

I'm growing a web server in Haskell that interfaces with TCP sockets using network. To read the HTTP header of the client's message, I use the following function: ...
Matthias Braun's user avatar
5 votes
2 answers
247 views

Network IP packet tracker

this is my code for watching IP packets. I am doing project for my self because I want to learn how this things works. This is my IP Packet class: ...
TJacken's user avatar
  • 291
3 votes
0 answers
176 views

one-thread blocking approach for socket tcp multi-client server

my use-case (an home task to practice abstraction, exception handling, unitests) is regarding a message-queue with small-fixed-size client requests from stdin of such: [ENQ] data (insert json ...
a.k's user avatar
  • 151
5 votes
1 answer
3k views

Streaming Messages to multiple Clients

I wrote a server-client application in Python where the server sends a never-ending stream of messages to connecting clients. I was in need for such an architecture since I want to retrieve and ...
Scholar's user avatar
  • 103
1 vote
1 answer
116 views

Async Tcpwriter and Reader

I currently have a class that I want to serialize/deserialize messages sent to this socket. My plan was to use Task.WhenAny() to monitor 2 tasks (Either watch ...
Blue's user avatar
  • 79
13 votes
3 answers
10k views

C# TCP server/client class

Goal My goal is to create a TCP server/client class that can be universally reused in various private projects. It should work stable and does not need to be super fast, but rather light-weight to ...
dadul96's user avatar
  • 153
6 votes
0 answers
2k views

Implementing a TCP client in Golang

I am very new to concurrent programming in general and want to know if my implementation is thread-safe. I'm currently working on implementing a TCP client in golang. The service listens on a port ...
Jayaram's user avatar
  • 213
1 vote
1 answer
295 views

F# Simple message reader using TCP

I have a review request about this part of the code: ...
Wojciech Szabowicz's user avatar
1 vote
1 answer
1k views

TCP server in Android to continuously listen to an RFID reader

I have created a TCP server thread which I want to keep running and listening to the IOT device (an RFID reader). I have only one client. Please review my code and provide your feedback. Are there ...
Vivek Panchal's user avatar
3 votes
1 answer
1k views

A simple TCP command executer

In https://github.com/pc-magas/tcp_command as an attempt to learn C++ I made a simplistic TCP server in GNU/Linux that will receives simple "commands" in ASCII form. Each command ends with '\n' and a ...
Dimitrios Desyllas's user avatar
4 votes
2 answers
261 views

Tcp server messenger awaiter in f#

Hi I have a simple tcp server, and that server receives messages with specific length so basically i need to wait for TcpClient to fill buffer with that amount of data, and it works. But I am not ...
Wojciech Szabowicz's user avatar
4 votes
1 answer
4k views

Socket chat room made with Tkinter Python

This is a real live chatroom that I have made with Tkinter I posted a question before about making a chatroom but the problem that I had with that one was that only one user could connect to the ...
colkat406's user avatar
  • 482
-1 votes
1 answer
2k views

C# Handling Task Cancellations/Timeouts and Exceptions [closed]

I am very new to Tasks and therefore new to handling task cancellations and task exceptions. I wrote this method that gets a List which is then used to populate an ObsservableCollection shown in a ...
cd491415's user avatar
  • 107
1 vote
0 answers
147 views

Socket sending/receiving data

I am a beginner in Android and this is my first big project in it. I am trying to communicate with an STM Discovery board using an ESP01 module. Below is the client connection class ...
ION GROZEA's user avatar
6 votes
2 answers
3k views

Socket chat room in Python

This is a Python chat room that I've been working on and it enables to you to chat to other people on the same network through Python. Server.py: ...
colkat406's user avatar
  • 482
3 votes
0 answers
1k views

TCP client reading socket asynchronously

I'm relatively new to .Net/UWP networking and have been trying to make sense of the APIs. I'd like to implement a TCP client that is capable of reading and sending messages independently (there is no ...
trzy's user avatar
  • 31
8 votes
1 answer
2k views

TCP client and server API

I made a server and client API for TCP connection. It is intended to shorten the work you need to do to prepare the server and client. It's separated into 3 projects - ...
Denis's user avatar
  • 8,478
7 votes
1 answer
5k views

Non-blocking TCP and UDP in Unity3D Game Engine

I would like constructive criticism of a networking plugin I've written for Unity 3D. The use-case of the code is for people in "creative coding," where simple TCP and UDP messages are used for ...
Yosemite's user avatar
  • 137
1 vote
0 answers
2k views

Flask app for control TCP server

This snippet allows to up and down TCP server via Flask endpoints. I'm seriously concerned about global variables here. And asking for review this code. The main idea is to be able to up/down TCP ...
Laser's user avatar
  • 111
1 vote
0 answers
1k views

Transfering Image Data with QTCPSocket

In my program I am transferring image files continuously through QTCPSocket for each frame I am creating new connection which I believe causes the performance problems. But I couldn't transform my ...
onur cevik's user avatar
4 votes
2 answers
2k views

Simple multithreaded chat server in Rust

I'm trying to develop a simple Rust chat server. I'm not a Rust expert and come from Java and Kotlin. This same server in Kotlin is: ...
francesc's user avatar
  • 181
1 vote
1 answer
4k views

Multithreaded non-blocking tiny echo server

I wrote this code to make a non-blocking server without using select(), my main concern is to catch as many exceptions as possible for worst case scenarios (so I ...
Algo's user avatar
  • 339