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
10
votes
2answers
4k 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 ...
3
votes
2answers
12k 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 ...
4
votes
0answers
801 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 ...
2
votes
0answers
71 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 ...
3
votes
0answers
86 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 ...
1
vote
0answers
1k 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 ...
5
votes
0answers
36k 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 ...
4
votes
2answers
4k 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 ...
5
votes
2answers
103 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 ...
4
votes
1answer
374 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'...
8
votes
2answers
37k 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 ...
3
votes
1answer
11k 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 ...
6
votes
2answers
141 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 ...
3
votes
2answers
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 ...
6
votes
1answer
366 views

Flexible socket framework

I'm working on an async socket server, would really appreciate any critique and some advices regarding the place where i process received messages. My interfaces are as follows: IAsyncClient <...
1
vote
1answer
1k views

Multithreaded telnet chat server in Java

I have writed a multithreaded telnet chat application in Java. In main method I run telnet server. In server class at run method I bind in specified port (8189) and I spawn listener threads for every ...
3
votes
1answer
1k views

TCP/IP multithread chat

I'm learning C# and would love to receive some feedback for my code. Server: ...
4
votes
1answer
522 views

Writing a chunk of a file to a socket in Swift

I'm writing a chunk of a file from an offset to a socket. This is my implementation and it's working OK from my tests. Any comments or speed improvements? ...
1
vote
1answer
4k views

IP Scanner via python sockets

Please review my code for scanning active IP address . Please Suggest improvements ... ...
6
votes
2answers
10k views

Protocol implementation, TCP, sending images through sockets - follow-up

I would like to ask about your opinion about my code. The idea is simple: I designed my own protocol, where client asks server about the image, and the server sends the image, following the below ...
10
votes
1answer
3k views

Network protocol using TCP, sending images through sockets

I would like to ask about your opinion about my code. The idea is simple: I designed my own protocol, where client asks the server about the image, and the server sends the image, following the below ...
1
vote
1answer
346 views

Player Packet System

I have recently coded a system where an instance of class Player is created for each connected socket, once the player class has been created, in its constructor the Socket that connected starts ...
23
votes
2answers
8k views

Simple and effective port checker in C++

Intro A couple of weeks ago I finished a Python implementation of a multithreaded port checker and I wasn't quite happy with the result I've got (speed). I needed it to be faster, so I've built ...
18
votes
2answers
3k views

Python bot to answer mathematical questions for a remote server

The MSP Tech Club puts on an annual CTF, available here. I've worked on a solution but was wondering if there's a better way to write it or if I have any particular bad habits showing themselves? The ...
4
votes
1answer
10k views

C multithreaded chat client and server

I've written a TCP chat application for the command line that supports multithreading. I'm wondering whether I'm using best practices for socket programming, what other types of functionality would ...
4
votes
1answer
73 views

Let's check that domain port

Intro This simple script will allow me to check for a specific opened port on a list of domains that I own. Instead of manually doing this check, I found Python a pretty good idea for such a task. ...
2
votes
0answers
37 views

Class which encapsulates related socket streams

I have a class which encapsulates stream related objects, and I have provided the method API for doing basic manipulation on the stream read/write/close, but is this a good approach? The only benefit ...
2
votes
1answer
202 views

Receiving messages from TCP socket and processing them

I would like someone to look at my class for reading messages from a network socket. In short, the whole app should behave like a regular ping command with some additional functionalities. The point ...
3
votes
1answer
601 views

Subclass of socket with optional TLS

...
4
votes
4answers
8k views

Socket client in C using threads

I'm working on socket programming in C. I have no problem with usage the threads. This all works fine but I'm new in this area. I wrote this code in client.c but is there any misused code or something ...
2
votes
1answer
10k views

Implementation of an asynchronous UDP server Listener

I have written this code in C# and have tested this code to ensure it works well. Any other suggestions for this code would be appreciated as I have a number of users who are sending data on this port....
3
votes
0answers
183 views

Download website source through Socks4 using Winsock

I just have started to introduce myself into network programming using C++. So I started with Winsock. The code I made is compiled with MinGW and works perfectly! As a beginner, the main purpose of ...
2
votes
1answer
5k views

Simple TCP Listener class

This is my first winsock TCP listener ever written. I can use it for a small framework. tcp_listener.h: ...
3
votes
0answers
125 views

msysGit to Unix sockets

I wrote this small script to help porting msysGit sockets to WSL ("Bash for Windows"). I'm not a big Python programmer so any feedback would be well appreciated. By the way, I made it a public Gist ...
1
vote
1answer
627 views

Reading socket stream to parse XML, queue messages, run system cmd in thread

I've had great experience in the past getting feedback from uDev and python, but I'm dreading this attempt at C++. I have a little background in C - but absolutely none in C++ - so this code is ...
4
votes
1answer
1k views

Simple file server for GET requests

I recently made this simple server in C for Linux systems and was wanting to get another set of eyes on it for a review of the design. I am new to socket programming and used a textbook from school to ...
3
votes
1answer
1k views

TCP socket server using OpenSSL

I've written this basic TCP socket server that uses SSL. This is my first experience with sockets in C++. The client is a Qt desktop application. Code overview: Receive incoming connection. Check if ...
1
vote
1answer
308 views

Simple PacketHandler class [closed]

I can recently coded an emulation system and in this project I have a PacketHandler for each player connected to a socket server, and each player receives packets (data) from the client application. ...
2
votes
1answer
219 views

Penetration testing in an unsuitable environment

There are good penetration testing tools in the market in which we can perform various activities gather information from the hosts effectively. But those tools are not helpful always like if we are ...
2
votes
0answers
6k views

Blocking TCP Client with Threads vs. Non-Blocking TCP Client with Unitys Update

I'm not sure if this is the right subsite of stackexchange because it's not only about code review but a bit about design eihter. I'm currently developing a network application. I need to connect a (...
5
votes
4answers
20k views

Multithreaded Client/ Server communication

This is my first network programming codes writing for a client who has the following requirement: My Server has to run 24*7*365 for multiple clients at the same time (concurrency). Their Client (...
1
vote
0answers
3k views

TCP Server using Winsock IO Completion ports model

I implemented a tcp socket server using the Microsoft IO Completion Port Model, which is basically an asynchronous model where WSAXXX function return immediately and you use a worker thread to handle ...
4
votes
1answer
2k views

TCP chat room in Python

I have recently started looking into networking with Python. I saw some tutorials about the socket library so I decided to give a "live chat room" idea a go. It works (on Windows, ...
7
votes
1answer
4k views

Async TCP client/server

I'm working on a simple async TCP client server application, i'd like my network code to be reviewed. I really feel that I'm doing something wrong, especially in receiving code. Interface for client: ...
3
votes
1answer
268 views

C++ Syncronous Poll Wrapper v2

I recently asked for some feedback on my design for a syncronous wrapper around linux sockets and poll Based on the feedback, I created a new (hopefully more idiomatic) design. socket.h ...
2
votes
2answers
2k views

C++ Socket syncronous poll wrapper

Below is a simple C++ abstraction over linux sockets, and a layer of abstraction over a synchronous poll call. The goal was to exploit move semantics to allow the ...
7
votes
3answers
390 views

PlayerConnection class for Gaming Emulator

I have programmed a Gaming Emulator in C# and I have a class to handle all the connection side of things for the player, here we continuously listen for packets (each packet has a ID like a number, ...
2
votes
2answers
123 views

Termbin.com clone (commandline pastebin)

For fun I decided to write a 'real' Haskell program. The intention of the program is that it listens on a socket on a given port for input. The client can send some raw text on it and the server ...
4
votes
1answer
7k views

Custom Python 'Server Status Checker'

I've written a home-grown solution for checking the status of my servers. This is both an exercise for me in learning further about Python, but it's also critical to status-checking critical things ...
1
vote
1answer
1k views

TCP client library using Winsock WSAEventSelect in C++ - Take 2

This is my second take on creating a tcp client C++ class. The class declaration is general but the implementation is Windows only at this stage and uses the Microsoft Winsock WSAEventSelect model. ...