Questions tagged [sockets]

a data structure that provides access to inter-process communication. For the past 40 years, this basically means network communication.

Filter by
Sorted by
Tagged with
1 vote
1 answer
159 views

Is it more secure to develop libraries in-house than using existing libraries? [closed]

I (unfortunately) work in a large German corporation, in a department where the codebase is up to 20 years old, written in C++ (actually more like C with the occasional classes, since most developers ...
hyperbole's user avatar
2 votes
1 answer
158 views

Socket Class Design C++

I am currently trying to design some C++ classes that encapsulate POSIX sockets and their relevant functions. I want to try and design classes that are simple, elegant, and make the best use of design ...
nick2225's user avatar
  • 129
0 votes
0 answers
665 views

How inter-process communication is handled on .NET Core?

I have to implement a bi-directional communication between two local process with support to backward compatibility .NET Core/NET Framework and platform architecture x86/x64. The options that i have ...
youssef jirari's user avatar
0 votes
0 answers
177 views

Deployment of two programs that communicate between them

On windows, I have done one client in c++ and one server in python. In order to make the program work, I need first to run the server (in one terminal), and then I can run the client. I am trying to ...
thecatbehindthemask's user avatar
-2 votes
2 answers
2k views

What are the possible *root causes* of a SocketTimeoutException?

I understand that a SocketTimeoutException (I'm in Java, but I guess it's the same in just about every major language) happens after a server or client doesn't respond after a period of time, let say ...
Mickael Bergeron Néron's user avatar
0 votes
1 answer
86 views

How best to structure this MVC or Razor Pages web application given a required tcp/ip server data source that acts like a web api?

I am rewriting an old asp.net 4.0 web forms website that exposes an application's data and logic to the web. I am moving this to a .net core mvc or razor page project. The website has minimal ...
Zevias's user avatar
  • 9
4 votes
0 answers
868 views

Is there a conventional URI scheme for local sockets (AF_UNIX)?

I'm looking at creating a class which accepts a string to define a Unix socket address. Linux supports three types of addresses for Unix sockets: File based addresses (also called named domain ...
Alexis Wilke's user avatar
0 votes
1 answer
429 views

Asynchronous Server in C++

We are looking to develop an asynchronous server in C++. We are coming from C#, which has built-in support for async-await networking. However, with C++ it appears as if it is basically mandatory to ...
lol's user avatar
  • 113
1 vote
1 answer
214 views

How should I handle dealing with a stream of incoming data?

I'm creating a NodeJS application that receives a ton of incoming financial data (prices) through Websockets, like anywhere from 1 to 5 data points per second which I would then like to send to the ...
WildWombat's user avatar
-5 votes
1 answer
1k views

What are services and interfaces of a layer in a computer network model? [closed]

In Tanenbaum's Computer Networks book Three concepts are central to the OSI model: Services. Interfaces. Protocols. Probably the biggest contribution of the OSI model is that it makes the ...
Tim's user avatar
  • 5,415
-1 votes
1 answer
43 views

How to check whether module or class is network interface, socket?

Background Simplifying, assume I want to write some tool for code-analysis, which tell me which files - class/module - are/have some kind of network interface(s). No matter if it's REST Controller, ...
xana's user avatar
  • 117
-4 votes
2 answers
79 views

How do browsers isolate traffic within a single tab?

I know that browsers use a separate port for each tab. However, in each tab, there might be multiple scripts doing data transfer over the network. How does a browser makes sure that the data is ...
marked-off-topic's user avatar
2 votes
2 answers
1k views

Chat part of application - using UDP or TCP?

I'm trying to build a section of my app where two users can message each other. I've read about TCP and UDP and it seems like TCP is more suited due to ordered packet delivery. However, TCP requires a ...
Callum's user avatar
  • 121
2 votes
3 answers
177 views

How do you resolve a byte[] into a class instance in a way that doesn't couple the serialization/deserialization contexts together

Consider that you've got a POJO that you intend to serialize and send through a socket. You can use whatever serialization strategy you wish (JSON, XML, protobuf, ..., etc) to serialize the actual ...
tgabb's user avatar
  • 131
1 vote
1 answer
275 views

Instant Messaging with WebSocket

I am trying to develop an Instant messenger using WebSocket. I have multiple instances of my servers running (say server1 , server2). Two users(say userA , userB) who wants to chat with each other. ...
Jeevi's user avatar
  • 149
1 vote
1 answer
139 views

Is my server design safe regarding multiple threads and concurrent database reads/writes?

I'm making a chat server using sockets and a MySQL database, and after it's working I want to expand it to become a more complex game server. I want to know whether my design is missing anything. ...
Gimme the 411's user avatar
1 vote
1 answer
428 views

What are the limitations of WinSock2 sockets within threads?

I've run into some strange behavior on an application I'm developing in C using the windows API. Im trying to implement a closed connection server-client interface. However, for whatever reason ...
KeatonB's user avatar
  • 129
-2 votes
2 answers
118 views

Why does an POST request from HTML/JavaScript generates 401(unauthorized) but it doesn't from a C program?

I have to send a POST request with some data to a RESTful API. Right now I have a C program that creates a socket, connects with the host and successfully sends the POST request. After some C magic, ...
m4l490n's user avatar
  • 117
-2 votes
1 answer
188 views

Are all sockets implemented as per the Berkeley sockets specification?

Are all sockets implemented as per the Berkeley sockets specification in all platforms or languages? What I am trying to understand is; is this the only standard for sockets implementation or there ...
Sisir's user avatar
  • 828
0 votes
1 answer
373 views

Prioritizing messages sent over a socket

I'm looking at the source code for a client - server program that communicates using TCP sockets. 5 connections are used to communicate, named very_slow, slow, medium, fast and very_fast. A socket is ...
Q-bertsuit's user avatar
0 votes
2 answers
187 views

Possible microservice based design

Here are the design considerations for a software. The querying of data should be as fast as possible (reader <1s, writer <2.5s possibly since it also take time to reach the client end web or ...
Simple Fellow's user avatar
0 votes
2 answers
1k views

Where is the difference with client-socket port and server-socket port?

If we decided to create a (TCP) socket-server (for example) on port 12336 imagine it like a: socket.bind(12336) and then to create a (TCP) client-socket for it, like a: socket.connect("12.34.56.78"...
sq179's user avatar
  • 23
4 votes
1 answer
368 views

(C++) Ideal design pattern for associating requests/responses on socket?

I'm working on my first big C++ project and while I understand the language I'm trying to learn elegant design patterns using it. I have some low-level networking over a UDP sockets API where each ...
A Tyshka's user avatar
  • 151
0 votes
1 answer
142 views

Do TCP Sockets need validity/security checks?

I am currently building a distributed system that consists of two separated nodes, connected over wireless Lan. The processes communicate over a bidirectional TCP Socket and JSON messages. For the ...
Euestros's user avatar
0 votes
2 answers
954 views

Which is better approach - using subprocess vs communicating over socket?

I have been working on a python project for sometime which has been structured in following manner: We have a function like this: def execute_cmd(cmd): (out, err) = subprocess.Popen(cmd)....
shriroop_'s user avatar
  • 101
0 votes
1 answer
337 views

Network Communication - queue processing thread/task or?

I have an application that is sending messages over a socket from different threads. I create my own wrapper for the socket that enables me to extend functionality. Example - on new ...
Markushamton's user avatar
0 votes
0 answers
212 views

How to analyse the throughput of multithreaded client server programs?

I am practicing socket programming in C language. I have two codes - server and client (based on TCP) on two different laptops. The server forks a new process for every new request. For simulating ...
Akshdeep Singh's user avatar
0 votes
1 answer
3k views

non blocking udp socket send receive

I'm writing some embedded Linux software where we have two microprocessors on the same PCB and they communicate with each other using UDP through a switch that is embedded on the PCB. Each application ...
Alpha's user avatar
  • 9
1 vote
1 answer
257 views

Should worker processes accept() or should they get data from the master process?

I'm trying to write an application server in python. I have a master process and multiple worker processes created from the master using fork(). I have two approaches in mind about how the workers ...
akshay takkar's user avatar
0 votes
1 answer
65 views

Optimising network data usage in vehicle tracker

I'm currently working on an Android application that broadcasts the location of the device every 5 seconds. Pseudo showing current app process: deviceLocation = getLocation() if (hasChanged(...
jskidd3's user avatar
  • 103
0 votes
1 answer
250 views

How to efficiently solve "close" players/items in an online game without iterating through all of them?

I have an online game server that works as follows: Once a player connects, he is in one of predefined sessions (consider them physical location, e.g. Island, Underground location, etc.). Then ...
John V's user avatar
  • 4,908
3 votes
0 answers
569 views

Design a Windows Service with self-hosted ASP.NET Core Web Services and UPD port listeners

I'm designing a software platform in automation that is responsible of many different tasks like: Core functions Driver interface for machines UDP listener for machine messages from PLC UDP listener ...
Cheshire Cat's user avatar
3 votes
3 answers
6k views

Proper way to send custom data structures by sockets

I'm wondering what is the proper way to send structures as char array by sockets. At this moment I have somethig like below but it isn't good solution because it causes undefined behavoiur. Is it ...
bielu000's user avatar
  • 267
1 vote
0 answers
2k views

what's the maximum number of simultaneous java socket connections in the cluster?

we work within a cluster of 1 gb/s of bandwidth, we use java sockets to perform some data transfer between the cluster's nodes like broadcast and shuffle (nodes of the cluster exchange data) in the ...
Soulimane Kamni's user avatar
0 votes
1 answer
3k views

Is it better to listen on multiple ports than listening on single port?

In my server, I have 1000 threads that are listening to 1000 different UDP sockets. When a thread receives a packet it puts the UDP packets on a thread-safe queue. The code is like this. while(...
Al-Alamin's user avatar
  • 109
4 votes
1 answer
2k views

Scaling tcp/ip socket server applications

I have been trying to understand how one would scale an application utilizing tcp/ip sockets for client server communication. For example in the simple diagram below: +------------+ | ...
nullReference's user avatar
1 vote
2 answers
176 views

Is it appropriate to rely on the fact that state doesn't exist for other users coming to the same address?

I am writing a web app. I want users to be able to go to a URL and start a new "session" of my app. They can Slack their friends/colleagues the URL and then everybody is in a socket-connected scenario ...
James's user avatar
  • 359
3 votes
2 answers
3k views

Socket on a webserver

So what I know about socket is that a socket is an end point of a connection for a process, hence 1 socket on a host binds to an IP and a unique port number for each connection. But a webserver (by ...
td16's user avatar
  • 167
0 votes
1 answer
1k views

File Transfer over Socket

I'm trying to build a simple file transfer program that transfers a file from a server to a client. I gave it a try myself by simply writing the file to an ObjectOutputStream. This didn't work. I did ...
namarino41's user avatar
4 votes
2 answers
989 views

Is briefly closing a listen socket then re-opening it a horrible idea?

I'm writing an application on x86_64 CentOS 7 that functions as a server, managing potentially thousands of devices. Because my application doesn't do so well when running through the connection ...
Lightness Races in Orbit's user avatar
4 votes
1 answer
2k views

Why is it a bad design to designate one thread to send data on a socket and the other to receive data?

I posted a question on SO whether two threads can simultaneously execute a send() and a recv() on the same socket. I was told that while they could, implementing this was an example of a very poor ...
gaazkam's user avatar
  • 3,527
17 votes
2 answers
6k views

Why can't sockets be used to identify individuals instead of cookies?

Another question was asked regarding the use of IP addresses to identify individual clients. I think I understand why an IP address is insufficient. But what about the socket, which has more ...
user avatar
2 votes
2 answers
150 views

How do network loops actually "catch" connections reliably?

Take for example, a simple web server in C's loop: while(1) { /*accept connection that comes into server_socket and assign its handle to client_socket*/ client_socket = accept(...
the_endian's user avatar
  • 1,114
1 vote
0 answers
868 views

IPC with Node.js server

I built a post processor for creating CNC machine files to which I'd like to provide a web interface. Currently the program takes a file path as input and then spits out the results into another file....
oorst's user avatar
  • 139
2 votes
1 answer
705 views

Possible ways of implementing an HTTP proxy with priority mechanism

I'm working on a TCP HTTP proxy: need to turn it in a priority proxy. The standard proxy used to deal every connection with a fork and the child process handles the connection. Now I've implemented a ...
elmazzun's user avatar
  • 271
2 votes
1 answer
7k views

bind() call in socket programming

I am reading about socket programming and got to know that ip is assigned to socket with bind() call before connection to server.Is my thinking of binding address means to bind any ip address correct.
Jeevansai Jinne's user avatar
1 vote
2 answers
76 views

Can packet sizes be relied upon in TCP/IP, at least for the first read() call on a connection?

Assume you have a client application which is known to connect to a given IP, and send a fixed size message (of size X = ~dozen bytes) upon connection, and wait for a reply. If you're writing a ...
Bwmat's user avatar
  • 769
3 votes
4 answers
664 views

Does a full duplex communication object conflict with single responsibility?

I'm writing a Websocket implementation in Java, and I've set it up so that it basically just wraps an InputStream and OutputStream, and has public methods for both sending and receiving. While input ...
codebreaker's user avatar
  • 1,694
2 votes
1 answer
1k views

Is there a cross-platform way to open a TCP connection, send a HTTP post request and keep the connection open?

I'm searching for a way to open a TCP connection, send a HTTP post request and keep the connection open. It would be great if I can achieve this without administrator/root rights, from a command-line ...
Bob Ortiz's user avatar
  • 131
-6 votes
2 answers
2k views

ArrayList Dynamic remove and add for socker client [closed]

I have one ArrayList in Java and a save the socket and one unique id. When someone client is add in the ArrayList, the unique id i have is NOT the same with position in ArrayList. When someone ...
pioupiou's user avatar
  • 101