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
7 votes
3 answers
2k views

Simple TCP port scanner

I’ve done port scanner program. It works well and accurate, but there is a problem. It’s SUPER slow. That’s how it looks: ...
Eudziro's user avatar
  • 81
4 votes
1 answer
93 views

Writing a HTTP server in C

Code ...
Dang Quang Vinh's user avatar
8 votes
3 answers
677 views

Send arbitrary number of arbitrary length buffers in packets of fixed arbitrary size

Background: I am in earlier stages of implementing a standard on top of an existing 'backend' This standard requires that I send data in UDP packets of a size specified at runtime All packets must be ...
Douglas B's user avatar
  • 181
0 votes
1 answer
86 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
796 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
157 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
107 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
435 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
176 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
841 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
883 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
294 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
416 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
274 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
  • 439
5 votes
1 answer
2k 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
  • 439
2 votes
1 answer
181 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
610 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
483 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
44 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
503 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
143 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
160 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
  • 739
2 votes
0 answers
1k 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
67 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
210 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
215 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
134 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
237 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
101 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
345 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
115 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
  • 173
4 votes
1 answer
662 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
  • 173
3 votes
1 answer
169 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
502 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
82 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
325 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
4k 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
725 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
  • 249
4 votes
0 answers
278 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
885 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
722 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
97 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

1
2 3 4 5
7