Questions tagged [socket]

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.

Filter by
Sorted by
Tagged with
1
vote
1answer
42 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 ...
2
votes
1answer
60 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. ...
4
votes
2answers
221 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 ...
8
votes
0answers
55 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 ...
5
votes
1answer
43 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 ...
9
votes
3answers
96 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 ...
5
votes
1answer
263 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. ...
3
votes
1answer
67 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 ...
4
votes
0answers
83 views

Chat using async Python and sockets

I am trying out websockets using the python async framework aiohttp. Basically I have created a game which will include multiple ...
4
votes
1answer
93 views

HTTPS proxy server in Rust using the CONNECT protocol

I'm a Rust newbie. As a pet project, I decided to implement a simple multi-threaded HTTPS proxy server in Rust which uses the CONNECT protocol. I have tested the code below using my browser. ...
3
votes
1answer
69 views

Encrypted Online Rock Paper Scissors Game

I made an RPS Game with python with the Crypto and socket modules. I would like you to look at the code and tell me if anything ...
2
votes
1answer
25 views

Python Socket programming chat - getting a handle on PEP conventions

A while back I wrote a socket programmed chat in Python. This question isn't really about the program specifically, moreso on conventions of Python and my style of coding. I've only been using Python ...
0
votes
1answer
94 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 ...
0
votes
1answer
91 views

Basic asio framework using epoll

I created an asio framework using epoll. Full project: https://github.com/arkceajin/EpollSocket.git I wanna know is there any potential issue. Below is the core ...
3
votes
2answers
529 views

Adding a cancellation token to TcpListener.AcceptTcpClientAsync()

There is no facility in TcpListener (or for that matter Socket) to close a listening socket that is waiting for a connection without throwing an exception. After running up a test bench with 8 ...
12
votes
3answers
1k 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. ...
2
votes
0answers
38 views

Log tailing socket server

Each client application would send a filepath and search term to the server. The server then takes that file path reads the file and returns any lines that contain the search term, the server then ...
3
votes
0answers
38 views

Application uniqueness and unilateral IPC on Unix

This program Detects application uniqueness, if the application is a unique/primary instance, it launches a server, otherwise a client over a Unix domain socket. Client will send a message that will ...
3
votes
0answers
48 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 ...
6
votes
0answers
121 views

Single-threaded fully asynchronous server, with a SocketSelector that dispatches events

I need a fully asynchronous single-threaded server written using .Net Core. Searched for options and, surprisingly, did't find any. So I decided to write a simple prototype. Borrowed idea from python'...
3
votes
1answer
113 views

Java Networking Framework

So I've just written a framework that is supposed to make it easier to create a network-based application (client-server) using the native java.net package. I was wondering if the structure of my code ...
2
votes
2answers
408 views

Server and Client programs for guessing game

I recently had to complete this for a school assignment and I really enjoyed it, but was hoping someone with experience in OO design or maybe just Java in general could have a look and point out ...
5
votes
1answer
161 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 ...
3
votes
1answer
117 views

Capsulation solution for byte arrays

In a part of the project, I had to implement a solution for encapsulation of byte arrays. We do use ssh and secure ports for socket connection but I was in need of an extra layer of protection against ...
2
votes
1answer
64 views

Java file transfer through sockets

I am making a program that transfers files from one client to another. Right now I am just working on sending the file to the server and then later I will work on transferring it to the other client. ...
4
votes
4answers
1k views

Unix chat server making communication between terminals possible

This Server handles clients communicating with each other. Because I was not willing to actually give every client a name, they are named by their socket's file descriptor. This is my first ...
1
vote
0answers
361 views

Some questions about a simple asynchronous socket client [closed]

I am having a hard time to come up with a simple TCP client, that should use one socket and two threads (one for sending and one for receiving). As using TPL tasks is the way asynchrony should be ...
4
votes
1answer
56 views

Send / receive wrapper for System.Net.Sockets - follow-up

I recently posted a question about improving thread and socket safety in my NetworkEndpoint class. previous post I have implemented the changes suggested in the answer I got there. When I asked for a ...
6
votes
1answer
136 views

Send / receive wrapper for System.Net.Sockets

The following NetworkEndpoint class serves as a simple send / receive interface for either side of a network connection (client or server) when provided with a ...
3
votes
1answer
69 views

Small socket based packet Library

I'm currently writing a python script which needs some simple networking. After some playing around with sockets, this emerged, but as this is my first foray into sockets I'd really like a second ...
4
votes
0answers
901 views

C++ network stream

So, I'm new to socket programming. I wanted to get started learning, and start making stuff, but was really surprised to find out there was no standard C++ network library yet. I'd have to look for a ...
2
votes
0answers
40 views

Rust HTTP Requester

I am writing an HTTP client for terminal, similar to curl, as a learning exercise. There's one limitation it suffers from and that is that it won't return until the client closes the socket. I fixed ...
2
votes
0answers
48 views

Simple Socket Server in C for Windows

I have taken the code from a tutorial of Microsoft webpage. Of course, the example is for illustration only but I wanted to organize it and make it clear in order to understand it a little more. Here ...
14
votes
3answers
2k views

Simple HTTP Server

I'm working on a project (studying) and I have a lot of time for proof of concepts and write something from scratch. Basically I'm creating an HTTP server (simple, but not too simple) in C++ using ...
3
votes
2answers
1k views

C++ protocol for sending arrays over TCP

As someone who has programmed in C for a long time, I have just written my first C++ program and feel it would be very valuable to get a review of the code, to see what features of C++ I could make ...
1
vote
0answers
34 views

Java local service with sockets

My goal was to create a Java service on Windows that runs locally and communicates with local programs using JSON. The service should be reliable and robust. The service runs a ServerSocket and ...
8
votes
1answer
750 views

Python scanner for the first free port in a range

I have a distributed application (YARN), which runs a WebApp. This application use a default port to start (8008), before I start I need to check if port is in use. A container may run in the same ...
2
votes
0answers
148 views

Simple Go Linux daemon to send/receive gob-encoded data on a socket

I'm currently working on a linux daemon and would like some feedback. The program is a simple unix socket server that sends around gob encoded messages. I'm still getting the hang of concurrency in go ...
3
votes
1answer
2k 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 ...
1
vote
0answers
48 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 ...
1
vote
2answers
128 views

Creating a dict with external and internal IP addresses provided a list of candidates

I created a function that finds internal and external IP addresses, returns them in dict with the keys external_ips and local_ips...
2
votes
0answers
88 views

Web server using syscalls in Go

I'm new to Go and wanted to implement a web server using system calls to get a better feel for how everything works. I'm looking for feedback on idiomatic go especially error handling and using ...
6
votes
2answers
2k 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: ...
3
votes
0answers
552 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 ...
1
vote
0answers
33 views

Back-end web framework with sockets

I recently became interested in back end web frameworks in python, but I didn't want to use django or flask. (I want to make something similar to django or flask) So I decided to make my own. This is ...
0
votes
1answer
81 views

Android TCP server that maps data to an object and sends it to a service

This is a code for an android thread. This is a tcp server and gets data from socket, maps it to an object and sends that object back to the main service. If there is anything I'm doing wrong or if ...
1
vote
0answers
47 views

Managing multiple sockets in a network client in Python

I'm writing a small FIX client in Python (2.7, constraint I cannot waive for now, unfortunately). There will be multiple sockets, connecting to different ports, so I thought I'd create a ...
1
vote
1answer
2k views

Python Making Bruteforce Password Crack Faster

I made a simple password cracker using Python. But it's extremely slow. Here is my code: ...
2
votes
1answer
89 views

Await socket Response

I wrote this to make the "callback hell" more manageable on the part of the coder when using Socket IO, so that there wasn't really any callback hell to go with, just a simple await. This should work ...
3
votes
2answers
1k 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: ...

1
2 3 4 5 6