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
3 votes
1 answer
121 views

Java Messenger data transmission

This is a very simple concern, could somebody take a look at a few lines of my code? I'm writing a simple Java multi-user messenger, it is structured in a desktop client with a Swing GUI, a java ...
Constantin Müller's user avatar
0 votes
1 answer
503 views

Scanning the subnet by ip range

By applying the get_name and get_mac functions to the specified IP address, it is possible to estimate the network availability ...
Eugeny Tarasov's user avatar
6 votes
1 answer
160 views

Response dispatcher for HTTP server

I’m writing a small HTTP server (just for fun and education). One important part is the response dispatcher. Responses for each socket should be sent in the order the requests were received. The idea ...
Yura's user avatar
  • 203
7 votes
2 answers
689 views

Network Interface Object

I wrote a Network... thing (not really telnet); and it's pretty simple. No options, just straight I/O. It seems programs get so bloated easily. ...
motoku's user avatar
  • 2,521
4 votes
1 answer
857 views

Socket server in c#

I'm writing a socket server for a project I am working on. I'm used to working in .NET FW, but I'm attempting to write this using .NET standard/core. Particularly, I am concerned about managing ...
Ci3's user avatar
  • 143
2 votes
1 answer
308 views

Actively writing an HTTPS webserver in Python 3

Please help me improving this existing, working code. I am not asking you to change what it does, as it handles connections already perfectly as designed by my own specs. I just want the code to be ...
gavery's user avatar
  • 23
4 votes
1 answer
5k views

Large file transmission over socket in Python

To learn network programming in Python, I have written a small piece of code which is constituted of 2 modules, a client and a server. The server listens to a specific port provided on command line, ...
user6417's user avatar
1 vote
1 answer
364 views

cwe119.py - a semi-automated script to test your security against DoS attacks

What is it used for? This is a different script from any python script which performs DoS attacks. It's designed to practice parameters fuzzing in the requests (it's requested which parameter you ...
Leon's user avatar
  • 49
3 votes
2 answers
360 views

Send and Receive upto 200KB over TCP/IP socket

Code reviewers, I have changed code whatever be suggested by code reviewer and I want you to give me some feedback on the basis of my new code. I have written TCP server client code to send data of ...
ASid13's user avatar
  • 85
3 votes
1 answer
112 views

Construct and send an HTTP get request from scratch and print all the received data to the screen

My concerns: Is the code pythonic? Does the receive_all function make the code any cleaner or should that functionally be apart of the ...
Ricky Wilson's user avatar
  • 1,695
5 votes
2 answers
1k views

Send and Receive more than 64KB over TCP/IP socket

I have written TCP server client code to send data of any size (1 byte - 64KB) in a loop. The client (A) sends data to the server (B). B then sends the same data back to A. A matches the sent data to ...
ASid13's user avatar
  • 85
3 votes
1 answer
3k views

Server and client for pong game

This is a pong style game which is very basic but involves sending and receiving data using TCP. The data is encoded using pickle which seems to be very inefficient yet I am still using it. The ...
J.Fitz's user avatar
  • 479
6 votes
0 answers
4k views

Non-blocking C++ sockets [closed]

I'm trying to use sockets to create a simple client and server architecture and I'm wondering if there is any other way to create non-blocking, 'async' sockets instead using ...
bielu000's user avatar
  • 241
5 votes
1 answer
307 views

Deal with partial messages using SocketAsyncEventArgs

As you know, when dealing with SocketAsyncEventArgs, this is possible to receive partial messages and depending on the protocol used, you have to deal with it. In ...
Mathieu Paquette's user avatar
4 votes
1 answer
127 views

Handling a single connection to a server or client

I'm writing an asynchronous TCP server and client for a game in C# and in particular getting sending right is a bit tricky because calling BeginSend() before ...
Jesper's user avatar
  • 141
7 votes
1 answer
4k views

Event-based multi-client socket wrapper

For learning purposes I am trying to develop an event-based library/wrapper to communicate with many clients by using epoll. The wrapper was designed with the ...
766F6964's user avatar
  • 901
3 votes
2 answers
11k views

"Always stay connected" mechanism for socket connection

I'm calling Connect() for the first time I connect, I am then checking if the connection is still connected every 10 seconds if it is not connected it attempts to ...
Josh Hallow's user avatar
  • 1,305
0 votes
1 answer
75 views

First Time Programming Sockets

The following code was my first attempt at creating and manipulating socket variables. I compiled and ran the code through cmd. What are the most common ways to organize methods in both a server and ...
Allie Marie's user avatar
4 votes
1 answer
3k views

C++ Poll Socket Wrapper Linux

So I created a C++ socket wrapper class using poll and events. The creation of the listening socket and binding is already handled in the initialize() method. I'd ...
Kyu96's user avatar
  • 141
2 votes
0 answers
62 views

Write one string to a socket within 10 seconds or another string if the time is out

I have implemented a method which will send one data to the server if it (Raspberry Pi Pin Input HIGH, in this case) occurs within 10 seconds. If this doesn't happen within 10 seconds then I should ...
Khojiakbar's user avatar
4 votes
1 answer
2k views

Callback pattern for handling socket response

I am in the process of learning go and am coming from a PHP, JS, and Nodejs background. I created a package that is a client which connects to a socket server and processes the data received from ...
kyle's user avatar
  • 183
4 votes
1 answer
1k views

A java IRC bot created for twitch

This is my Main class, all it does is start the bot object. ...
Kestrel_'s user avatar
  • 171
1 vote
0 answers
3k views

Async test client for TCP socket

I've made some modifications to the async client example found on MSDN for the purpose of testing a server application. It works entirely as I expect and/or want, even running multiple clients, but ...
En'gai's user avatar
  • 43
10 votes
1 answer
229 views

Point to point file transfer through HTTP socket

Why did I write this code This has a fun cartoon describing the problem of file transfer nowadays. And it's utterly true. There are already some webRTC based P2P file transfer services online. But I ...
Yuan Fu's user avatar
  • 207
3 votes
2 answers
166 views

String Isolation Class

As a lone developer I don't really have anyone to peer review my work in-house so I was hoping someone could take a look at this class and tell me in what ways I could improve it. Essentially what ...
En'gai's user avatar
  • 43
5 votes
2 answers
676 views

The start of a Python port scanner

My concerns: Is this module thread safe? Is there any obvious performance issues I missed? Is there a better container type to use for GENERATED_ADDRESSES other ...
Ricky Wilson's user avatar
  • 1,695
3 votes
1 answer
10k views

File Transfer over TCP

I'm working on an Asynchronous TCP Client/Server using the old BeginXXX and EndXXXSocket API. The goal of this hobby project is ...
Dom's user avatar
  • 183
3 votes
0 answers
1k views

Asynchronous sockets with begin/end and a state machine loop

Disclaimer: I am a C++ guy, so my C# is not even close. Therefore some review might be helpful. Here is my 4th attempt at a client using asynchronous sockets. Please give feedback. The hardest part ...
Christopher Pisz's user avatar
6 votes
2 answers
3k views

Networked Chat App in Python

I'm a highschool student with a passion for Python, and this is my first try at networking. GitHub server.py ...
user avatar
1 vote
0 answers
921 views

Socket server with consumer-producer design to handle concurrent connections

The usual way is to implement socket server to handle concurrent requests by creating new thread for each request. Instead of this approach i tried to create a server using ...
benjamin c's user avatar
2 votes
0 answers
1k views

Java Socket Proxy

I've been messing around with protocol handlers in Java, going so far as to write my own using a custom URLStreamHandler and ...
ndm13's user avatar
  • 718
8 votes
1 answer
3k views

C# Async Socket Wrapper

I'd like to get a little feedback on this async socket wrapper. My goal is to merge socket Begin/End methods into a single async call. I also wanted to wrap exceptions so they are easier to handle in ...
Walt Byers's user avatar
3 votes
1 answer
386 views

Port Availability Scanner, written in Java (9)

For purpose of practice and experience, I was working on a "Port Availability Scanner" written in Java. So far it's working but it's really slow. Especially on relatively large quantities of ports (...
Azoraqua's user avatar
2 votes
0 answers
293 views

Simple client/server library

I'm writing a Tamagotchi clone, and decided to try making an online version. Since I don't do a lot of networking projects, I decided to try and go off on a tangent and screw around with sockets and ...
Carcigenicate's user avatar
3 votes
0 answers
83 views

Live radio streamer

I've posted a repo on a live radio streamer much like shoutcast/icecast without admin panels / user panels or custom mounts. I was wondering if anyone could review it and tell me what I can do better ...
Thomas Queen's user avatar
3 votes
1 answer
493 views

One to One network file transfer code C# socket based

I have been developing a piece of software which has a central computer talk to many smaller nodes with a star network configuration. Each smaller node sends a file around 5MB in size once the central ...
user3797758's user avatar
10 votes
2 answers
7k views

Mocking socket calls in C++

Explanation I'm trying to get better unit test coverage of my server. I needed to mock out some system libraries (I could not find anything that worked easily for C++). Because I did not want to do ...
Martin York's user avatar
  • 94.9k
4 votes
2 answers
17k views

ReadAsync: Continuously reads stream and spits out Packets

I am creating a server client app where after the connection is done, the server and client will send packages back and forward. The Stream can be a NetworkStream or SslStream. I have created a Async ...
Eric S.'s user avatar
  • 41
4 votes
0 answers
1k views

Boost Asio Listener

I have developed a piece code to listen on a socket using Boost::asio. I would like to use that code in production. But before that, I would like to test it and ...
Kid's user avatar
  • 51
2 votes
0 answers
91 views

Small IRC library w/ message loop

So I felt like creating a small library to make IRC bots. It's separated in two classes. TelClient is a class that handles the low-level socket programming and ...
divx's user avatar
  • 83
3 votes
0 answers
161 views

Retrieving a certain amount of data from a socket [closed]

I'm trying to retrieve a certain amount of data from a socket, both Unix domain and TCP, but I've no control over its format or length. I discussed this with someone who told me to set my receiving ...
ruipacheco's user avatar
1 vote
0 answers
2k views

Protocol to parse packets using TCP

I posted this question a year ago and until a weeks ago I solved most of the issues that were happening due to incomplete packets, things like trying to read the packet header again when the payload ...
Kenny's user avatar
  • 247
5 votes
0 answers
39k views

Python video streaming server and client

Worked with same IP cameras for some time, and noticed that camera use much processing power because of multiple connections. Writing streaming server looked as nice solution so I decided to write my ...
Aleksandar's user avatar
4 votes
2 answers
6k views

Python proxy checker/scanner

Here is my attempt at a simple HTTP proxy scanner/checker. I've been learning python for about 6 months now and decided to move beyond simple scripts and data scrapers. I think the code looks messy ...
Aaron Nelson's user avatar
5 votes
2 answers
130 views

Nisse Server: Part 2 Socket Layer

Getting close to a release of generic server. Nisse Server: Part 1 Helper Functions Here is the socket layer code. This has previously been reviewed here. But there have been some changes. Socket.h ...
Martin York's user avatar
  • 94.9k
4 votes
1 answer
400 views

Flexible TCP socket framework

I'm working on a flexible socket framework and trying to polish it so it's actually something usable in further development. Would really appreciate any critique, also I’m really interested whether I'...
HardLuck's user avatar
  • 175
8 votes
2 answers
41k views

C++ Linux TCP client/server socket wrapper

I am relatively new to socket programming, so I would like to ask if there is anything wrong with my code :) For the server socket I included the great new C++ lambdas, so you can start an ...
dvs23's user avatar
  • 83
3 votes
1 answer
14k views

Multithreaded C# TCP Socket Server

I am trying to write a simple TCP server in C#. It needs to be able to receive packets and do work on them. Ideally it will only be receiving packets from a single computer, but I'm making it able to ...
user143311's user avatar
6 votes
2 answers
153 views

GameServer SocketListener + PlayerManagement

Today I was posting a question to get a bit of information on how to optimize my code for maximum performance. I'm a beginner to C# (in a sense) and I don't really know as much as all of you other ...
Seriosk's user avatar
  • 61
3 votes
2 answers
3k views

Sending a file over a socket with AES encryption

I'm not sure what's the best way to deal with streams that need to be closed whenever I'm done using them? Usually the need to also catch the exception inside the ...
AFP_555's user avatar
  • 133

1 2
3
4 5
7