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.
331
questions
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 ...
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 ...
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 ...
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.
...
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 ...
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 ...
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, ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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.
...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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
...
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 ...
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 ...
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 ...
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 (...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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
...
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'...
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 ...
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 ...
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 ...
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 ...