Questions tagged [socket]

For code which uses the Berkley Sockets API (specified by POSIX, and available on Windows too) to communicate with other processes using a network protocol.

Filter by
Sorted by
Tagged with
0 votes
1 answer
27 views

Handling multiple socket communication in Python Client-Server application [closed]

I'm developing a client-server game application in Python. Here's the scenario: Clients connect to the server and register. After registration, all clients see a main menu. One client can initiate a ...
wallyyopp's user avatar
1 vote
2 answers
248 views

Multi-Client Socket Communication with Thread Pool in C++

I've been working on implementing a multi-client socket communication system with a thread pool in C++. The system comprises three main components: logger.h, socket.h, and thread.h, which handle ...
user avatar
3 votes
0 answers
101 views

Simple Network Time Server in C++ with improvements from prior code analysis

From code review: OO simple network time server with changes from a previous code inspection and added Windows support I made many changes as per the review comments. The code has been significantly ...
arcomber's user avatar
  • 2,449
3 votes
1 answer
81 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
5 votes
1 answer
267 views

OO simple network time server with changes from a previous code inspection and added Windows support

I put up my SNTP Server code for review here: SNTPv4 server based on rfc 4330 in C++ a fortnight ago and since then I have made changes as per code review comments and also added support for Windows, ...
arcomber's user avatar
  • 2,449
6 votes
1 answer
144 views

SNTPv4 server based on rfc 4330 in C++

Please review my SNTPv4 server based on rfc 4330 I tested running 3 instances of ntp-check.exe from Galleon systems and 1 instance of Microsoft w32tm - w32tm /stripchart /computer: No crash! This is a ...
arcomber's user avatar
  • 2,449
10 votes
5 answers
803 views

Follow Up: struct sockaddr storage initialization by network format-string

This is a follow up to: struct sockaddr_storage initialization by network format string First of all thanks to @Haris, @Toby Speight, @G. Sliepen and @chux - Reinstate for their help. I learned a lot ...
mortytheshorty's user avatar
8 votes
3 answers
754 views

struct sockaddr_storage initialization by network format string

I am writing a wrapper library for network functionality in C and wanted to let the user let the user initialize a struct sockaddr_storage with a format string. Format ist like: "proto:host:port/...
mortytheshorty's user avatar
4 votes
1 answer
283 views

A deamon for sending poem to clients based on KISS

My code is about sending random poem from /etc/poem.conf to client using TCP sockets. In this implementation my daemon have restart mechanism using SIGHUP signal and DEBUG mechanism using defining ...
alirezaarzehgar's user avatar
2 votes
0 answers
268 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
2 votes
1 answer
309 views

Sending and receiving files in C win32 using a socket

I have a piece of code to send and receive files on Windows with C. Is this the right way to do it? And am I guaranteed that the full file will be sent and received? Receiving function: ...
Y K's user avatar
  • 83
2 votes
1 answer
236 views

The receive function for telnet client

This is a follow up question to Send and receive functions for telnet client. I am designing a simple wrapper around the telnet client using libtelnet for text-based communication to a telnet server. ...
ravi's user avatar
  • 429
4 votes
1 answer
1k views

Send and receive functions for telnet client

I am using libtelnet to design a telnet client by sending text commands to a telnet server and receiving text responses. I am utilizing telnet-client.c. For simplicity, I made send and receive ...
ravi's user avatar
  • 429
2 votes
1 answer
141 views

Priority Job/Task Queue for Linux (sockets and multithreading)

Preface Please review my implementation of a job queue for linux/unix systems. This is my first time coding in C, although I have quite some experience in C++. I know this is a moderate amount of loc, ...
infinitezero's user avatar
6 votes
1 answer
1k views

Proper way to send and receive buffer in Winsock

I have a piece of code to send and receive buffers. Is this the right way to do it? And am I guaranteed that the full buffer will be sent and received? receiving function: ...
Y K's user avatar
  • 83
1 vote
0 answers
465 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
439 views

Asynchronous socket server implementation from raw sockets

I've rewritten my HTTP server several times over the past year, because I tend to encounter an issue midway through an implementation realizing I didn't abstract, decompose, or decouple certain ...
uspectaculum's user avatar
2 votes
2 answers
1k views

Programming Challenge: Python 3 DNS query resolver using socket

This is a DNS query resolver written in Python 3 using socket, I wrote it entirely by myself, it supports 8 primary DNS query types: A, NS, CNAME, SOA, PTR, MX, TXT,...
Ξένη Γήινος's user avatar
0 votes
1 answer
40 views

Python Socket Class transfer functions for any networking related program

This code is meant to send an object (any object) over a connection to a recieving program. I want to make sure that i haven't made any red flags. It seems to work fine, i've sent tuples with data (...
128BitDS's user avatar
2 votes
1 answer
421 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
118 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
139 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
  • 719
2 votes
0 answers
969 views

A reuseable reconnecting TCP socket with Asio

I'm using (non-boost) Asio 1.18.1 and C++17. Forgive the boost tag, there wasn't a more specific one. I have a async_connect_with_retry composed asynchronous ...
MHebes's user avatar
  • 143
0 votes
0 answers
59 views

One-way chat which encode messages, this is the server side

This is one of my first real projects in python. It's basically a one-way chat where the server sends away an encoded message. The logic of it is pretty simple and I know there is some unnecessary ...
Daniel Sjöberg's user avatar
3 votes
1 answer
206 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
2 votes
1 answer
203 views

Time-Sensitive Synchronized Transfer of Data Buffer in C# to Multiple Clients

This is a C# program that is a reference implementation, it will be used to make a C version after it is stable and bug free. The programs are supposed to simulate sensor data collection and ...
temp's user avatar
  • 121
1 vote
2 answers
120 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
3 votes
1 answer
3k views

JSON packet transmitter

I'm not familiar with how data transmission works, but I gave my best shot trying to code a server and client-side JSON packet transmitter via Python. Essentially client.py generates random JSON ...
Joe's user avatar
  • 45
2 votes
1 answer
220 views

FizzBuzz JSON via Unix socket (Go)

At heart, this program is just the basic "FizzBuzz" program. However, the program was pushed further, by making it a client-server via Unix Socket: Server run, and listening on a socket. ...
farawi's user avatar
  • 23
1 vote
2 answers
96 views

Simple server to host simple website page with css

I have created a simple server that host html that has css. Please make sure if ur testing then change the paths relative to ur system in listhell.c in respond_main(..) function. The html file has to ...
user786's user avatar
  • 145
1 vote
1 answer
303 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
3 votes
1 answer
106 views

TCP chat room in Python3

(Previous question) I've created a server file, that keeps waiting for clients. When someone connects to the server, he can send messages to the server, and from the server it is broadcasted to all ...
irtexas19's user avatar
  • 163
4 votes
1 answer
531 views

TCP chat room in Python 3

I've created a server file, that keeps waiting for clients. When someone connects to the server, he can send messages to the server, and from the server it is broadcasted to all clients. Can you ...
irtexas19's user avatar
  • 163
3 votes
1 answer
165 views

Pomodoro timer daemon in C for BSD systems

I wrote a Pomodoro timer daemon for BSD systems in C (may work on Linux with -lbsd). The server uses poll(2) and sockets to communicate with the client and to ...
phillbush's user avatar
  • 864
2 votes
2 answers
498 views

Write deduplicated 9-digit numbers from concurrent clients to a log

Problem Statement: Write a server (“Application”) in Java that opens a socket and restricts input to at most 5 concurrent clients. Clients will connect to the Application and write any number of 9 ...
ProgrammingHandyman's user avatar
1 vote
1 answer
75 views

Utilizing idle socket server to do meaningful thing (timeout after sleep on epoll_wait)

I write an app server that uses TCP socket on Linux. When there is no traffic (no data is sent by client, no client connect() or ...
Ammar Faizi's user avatar
1 vote
1 answer
309 views

Java UDP port knocking authentication. Many clients at the same time

This is a student project of mine. I got 4/5 points but I suspect there's a lot of weird stuff in there. I never had a chance to hear my teacher's feedback about it and it bothers me so I figured ...
Student123's user avatar
4 votes
2 answers
1k views

C++ TcpServer class

I have a class Tcp_Server that implements a TCP server. This is the base class for the other types of servers available in my program. For example ...
Bogdasar's user avatar
  • 135
5 votes
1 answer
3k views

Secure socket programming with OpenSSL and C

Background Lately, I found OpenSSL to be difficult to learn as a beginner, while it can be implemented inside beginner-friendly projects like socket programming. ...
Ori David's user avatar
  • 175
3 votes
1 answer
649 views

How can I speed up the processing of the received channel socket

This currently runs with 1400+ sockets and manages data correctly and in the manner the application requires. I do have an issue with the HandleData method where ...
Adam H's user avatar
  • 161
1 vote
1 answer
66 views

Implementing classes in Javascript

I'm building a simple chatApp. The UI has just 3 interaction areas: input, submit and previous messages button. But I'm not interested in reviewing the app architecture as much as the javascript ideas ...
Minsky's user avatar
  • 239
4 votes
0 answers
240 views

Simple chat server in Python

I'm new to both Python and socket programming and figured setting up a simple chat server would be good practice. In addition to general critiques of the code, I have specific questions: What are the ...
JeremiahDixon's user avatar
1 vote
1 answer
800 views

Feedback on send/recv functions for non blocking sockets in client side HTTP library

I'm working with TCP sockets in C, specifically only for client side HTTP(S) requests, and would like to get some feedback on my send and recv code. You can make some assumptions regarding my code, as ...
Chase's user avatar
  • 197
2 votes
1 answer
2k views

Async tcp socket client: send multiple requests with one connection

I'm new to socket programming and c++. I have a the following method that sends an array to server and receives sum of the array, I tried to make it async. ...
Abraham's user avatar
  • 23
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
10 votes
2 answers
581 views

A Server and Client Chatroom Using Sockets and Threading

I made a chatroom with a server and client python files, using Sockets and Threading as a project. I'm interested to acquire ...
user avatar
5 votes
1 answer
77 views

A Program that gets text from a client and puts it into a file on a server

I recently created a program that could get information from a client, a name and some text, and then put that into a text file. From there the user can get open the text file straight from the ...
Emmanuel Okafor's user avatar
9 votes
3 answers
2k views

Parse string into a struct

I'm writing a C application for the Networking course at the University. Basically it's a UDP server that can receive two commands: GET key SET key value That are ...
gabrieledarrigo's user avatar
5 votes
1 answer
346 views

Server in Python

I'm looking for a code review and code improvement for my own small server. The server accepts the requests: User Join,User Leave,User Text Notify Group Join, Group Leave, Group Notify Request Time. ...
me4gqp's user avatar
  • 51
3 votes
1 answer
194 views

Finding the class to which the IP address belongs

I have tried the code for finding the class of the IP address the user inputs, and printing the network and the host bits in the IP address. Could someone please review this approach and provide ...
Paul's user avatar
  • 297

1
2 3 4 5
7