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

TCP server implementation in .NET

I wrote a couple programs in the past that use VB6's Winsock to achieve TCP communications, but still I'm kinda new to socket programming in .NET. I needed the same functionality of the Winsock to ...
5
votes
1answer
63 views

SOXXY: a daemon stated IRC client project

This script is basically a proxy service; except it doesn't require an active client connection. In fact it expects the client connection to connect before, and disconnect after every transaction. ...
2
votes
1answer
858 views

TCP client library using Winsock WSAEventSelect in C++

One way to write a client which uses a specific protocol, eg http like in this case, is to create a base class with the basic socket handling functionality with virtual functions which can be ...
0
votes
2answers
249 views

C++ Socket Part-4

In my ongoing attempts to become a better blog writer I have some written some more code that needs reviewing. Full Source: https://github.com/Loki-Astari/Examples/tree/master/Version4 First Article: ...
5
votes
2answers
163 views

C++ Socket Part-3

In my ongoing attempts to become a better blog writer I have some written some more code that needs reviewing. Full Source: https://github.com/Loki-Astari/Examples/tree/master/Version3 First Article: ...
5
votes
2answers
3k views

C++ Socket Part-2

In my ongoing attempts to become a better blog writer I have some written some more code that needs reviewing. Full Source. First Article. This is a simple C++ wrapper for Sockets. Here the bit I ...
4
votes
4answers
759 views

C Socket Part-1

In my ongoing attempts to become a better blog writer I have some written some more code that needs reviewing. Full Source: https://github.com/Loki-Astari/Examples/tree/master/Version1 First Article: ...
3
votes
1answer
168 views

A socket server that receives strings and prints them

Summary: Is my server handling every error and corner case possible? If not, what did I miss? Details I'm trying to write the most basic socket server I can, so I can learn TCP and the pitfalls of ...
2
votes
1answer
4k views

Protocol to parse packets

I coded this simple protocol but I'm sure that it can be better, this is the process: Reads incoming data Waits until payload size can be read Reads the full message Checks if there are mixed ...
3
votes
0answers
503 views

Event-driven UDP listener wrapper

I wrote this wrapper around the UdpClient,using events for new datagrams: ...
1
vote
0answers
2k views

Multithreaded client socket

This is my first time working with networks and multithreading in C, and would like to know how to make improvements. I wanted to make a client program that handles reading and writing to the server ...
3
votes
1answer
2k views

Chat server implemented using Java NIO

I am learning Java's NIO and as an exercise, I have implemented a simple chat server. I would like to ask if I am using NIO's features in the correct way. ...
-1
votes
1answer
3k views

async tcp server using async/await

Here is an async Tcp server using async/await I have written. I would be very appreciate if anyone can help to improve my code. Thank you! ...
3
votes
2answers
2k views

C++ Version of a Client/Server application

Starting to write an article about Socket Programing. So I need a simple C++ version of a client/server app. So here it is for review (Also on github) A linked question is the C version Makefile <...
5
votes
1answer
261 views

C Version of a Client/Server application

Starting to write an article about Socket Programing. So I need a simple C version of a client/server app. So here it is for review (Also on github) A linked question is the C++ version MakeFile <...
2
votes
2answers
151 views

Server socket “wrap” functions

This is a small socket library I made to avoid complicated C boilerplate code and several #includes for connecting sockets, bind, listening etc. Please note that <...
5
votes
1answer
651 views

Finding local C# servers on a Java client using UDP and reactive extensions

This program uses UDP broadcast to find app servers on the local network. When a server receives a client broadcast, it sends a port (integer) to the client which will later be used to create a TCP ...
4
votes
1answer
702 views

Java NIO server Selector loop

I have a server that uses Java NIO in non-blocking mode. Right now I'm using a single thread for the selector, and four worker threads to process the bytes after ...
5
votes
1answer
7k views

UDP Server Design and Performance

What I'm doing I am writing a server to work as my games backend. The server is being written in C# using UDP as the protocol, while the game is in C++. The biggest thing I've been focusing on was ...
2
votes
0answers
164 views

Android app that listens for commands over a socket

I've just begun programming Java and I'm working on the following code that deals with socket-based communications. Basically it connects to a client on port 8888: Gist of code ...
5
votes
0answers
610 views

A full-duplex connection to an IRC server

This connection class can be used, through composition, to make IRC clients for different kinds of IRC services. ...
3
votes
1answer
2k views

GPSD socket connection and decoding JSON into Python dictionaries

GPS3 is a python 2.7-3.5 interface to GPSD. I've stripped back everything to two classes. ...
13
votes
3answers
5k views

Replacing Skype, reinventing the chat client

I'm creating a chat client and chat server after a several month programming hiatus. The goal is to make one with features I want but it's also a learning project. Although it's mostly because I'm ...
5
votes
3answers
409 views

Python HTTP Server

This is one of my first times writing Python. I'm most curious about style and whether while 1: x,y = socket.accept() is an acceptable way to wait for new ...
2
votes
1answer
324 views

Testing a socket-based application

Summary: How can I best write tests that override socket-based communication for a library, capturing what is sent over the socket, and simulating responses based on what is sent? Details I'm adding ...
4
votes
1answer
818 views

Loop through List multi-threading to ping hostnames

I am new to Multi-threading. I have had a go at writing some code that loops through an ArrayList, gets a hostname and then pings the hostname. If the hostname is ...
3
votes
1answer
22k views

Reading and Writing Messages from a Socket

This is code from my android client which communicates over wifi to a small server program (not coded in java). This is my first time playing around with sockets, so I'm sure there are lots of little ...
1
vote
2answers
47 views

Program to let any user run a command

I have a script which can only be run by one specific user on a system. I need to let all users on the system have access to run that script and see the output. But there must never be more than one ...
1
vote
1answer
485 views

Server client for distributed system

This is the code I am using for a distributed system. The code will be used to allow the server to send parts of a (really big) document which will be processed by the connected clients. Please tell ...
11
votes
2answers
2k views

Command line IRC client

I made this IRC client ages ago in Python, and thought I'd revisit it for Python 3.5 (I'd like to play with asyncio). Before I start, I'd like to have an overall design review about this. Known ...
1
vote
1answer
103 views

Socket.ReadPacketASync

I'm working with TCP Sockets and I've build a simple packet struct that turns it into a datagram protocol. I've created a class which returns "promise" Tasks for Packets. Packets are very simple, they ...
1
vote
2answers
10k views

Find available ports on localhost

I'm writing code to find the available ports on 127.0.0.1. I'd like it to be faster, but it's functional now. ...
7
votes
1answer
675 views

Server-side of a chat application

I have written a server-side and the client-side of a chat application. I would like to improve it and I am unsure about my server construct and have absolutely no idea if there is a better way to do ...
0
votes
1answer
164 views

Server / client desynchronisation of messages [closed]

I'm trying to build a game where a client gets to play against a server in a game of Tic Tac Toe. I've built the game and followed a somehow structured design of how the game is supposed to happen, ...
1
vote
0answers
170 views

ByteBuffer Performance with Java NIO2 AsynchronousChannelGroup.withFixedThreadPool

I have a socket which will be receiving more than 100 TPS, so I need the reading to be as fast as possible. In this socket, I read the info I need to build a String and check if it matches a regex. I ...
2
votes
2answers
1k views

Simple TCP client-server solution

I have implemented a simple client-server solution using Java sockets and useful classes from java.util.concurrent. The communication protocol is rather simple: ...
2
votes
0answers
70 views

N Processing connect to a single process: Socket Programming

The idea of my program is to use pthreads, semaphores, posix shared memory, and sockets to create an environment where N processes (that we will refer to as the children) can connect to a single ...
1
vote
1answer
2k views

ISO8583 encoding data fields

I just want to confirm that my ISO8583 format is correct. Example: For the data field 35, the length of the data is 36, so I put 36 before the 4842. Then all the data is inserted in a string (...
-1
votes
1answer
180 views

Server listening for program sockets

Essentially I have a server that will be listening for sockets in other programs seeking a connection: ...
1
vote
1answer
45 views

Handling incoming socket data

Below I have some code that I use to handle incoming socket data, this is not full thing but its the part I am worried about, is there any way to improve this? ...
3
votes
1answer
431 views

Simple socket manager

I just wondered if someone could review this socket class for me. ...
1
vote
1answer
1k views

Python TCP echo server

The below code is a simple TCP echo server. The folks using it claim "it is going down every now and again". Any thoughts on how this could be improved would be really appreciated, particularly if ...
1
vote
1answer
282 views

node.js game CPU usage

My friend and I are making a node.js game, and we have been testing CPU. After profiling, it was determined that this process called zlib is sucking most of the CPU/RAM. 3 clients connected to a game ...
3
votes
1answer
302 views

POP3 message downloader using state machine processor

This simple program uses a socket class I wrote, class socket, to retrieve a users pop3 emails and print to stdout. I would like feedback on the socket class and the code to download the pop3 emails. ...
3
votes
1answer
2k views

TCP server with user accounts, connection threading, and groups/permissions

This is a TCP server I am currently working on. It is accessed through telnet (I know it isn't secure, its just a project for uni). The server is programmed in Python 3. I am currently trying to ...
4
votes
1answer
2k views

Winsock GET and POST Functions

This works fine so far, but I am looking for some advice as to how to better write this. My goal is to learn and incorporate current/latest C++ practices, and become a better programmer overall. <...
6
votes
2answers
2k views

Scanning for open ports

I made what started out as a web browser but now is a scanner for open ports. I wanted to know if you think this is a realistic or a unreliable tool for port testing. I found some open ports on my ...
5
votes
1answer
18k views

Multithreaded client server socket

I have created this library mostly for a learning experience with sockets and threading. For this review, focus on socket/threading. Let me know if I properly implemented both. If you want to comment ...
18
votes
1answer
3k views

TCP Socket Wrapper

I'm trying to build a simple server software for training purpose, most likely a IRC server, but I'm not there yet. I'm currently implementing a TCP socket class, to ease the use of the C socket API. ...
4
votes
2answers
12k views

Non-blocking Unix domain socket

I've developed quickly two kinds of socket use: the first with blocking mode and the second with non-blocking mode. The sockets are Unix domain sockets. My problem is that the kernel consume a huge ...