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
0
votes
0answers
79 views

Do connection and message coexist in CSP / Pi calculus?

Berkeley Socket API has two different kinds of network sockets: byte stream sockets: connection-oriented and message-less datagram sockets: connection-less and message-oriented. In Pi Calculus (and ...
-5
votes
0answers
87 views

How can we use `read()/write/send()/recv()` for datagram sockets?

In The Linux Programming Interface, Section 56.7 A typical datagram socket server creates a socket using socket(), and then binds it to a well-known address using bind(). Because datagram sockets are ...
-3
votes
0answers
37 views

Spoofing a UDP stream from a piece of software, to a third party app, in order to integrate with that app

I am working on a project where i am attempting to spoof a gps command from X-Plane 11 to allow a flight simulator that i am working on to communicate with an electroic flight bag app (Oz Runways) The ...
-4
votes
1answer
183 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 ...
0
votes
0answers
5 views

How to use UDP MulticastSocket for Reception with ThreadHandler-Looper-Handler in Android

I am trying to find the right architecture to be able to listen to UDP Multicast socket, receive the datagram packet that is in JSON format and then send the data to my BroadCast Receiver. It is ...
-1
votes
1answer
30 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, ...
0
votes
0answers
103 views

Express HTTP and socket.io - User upload of image and pass success of upload through to app instance

I've recently started a hosted app project for fun. It is effectively an application for playing tabletop card dealing/guessing/team games remotely. This is for games with custom sets of cards (...
-4
votes
2answers
62 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 ...
0
votes
0answers
33 views

How to properly structure a Game Server (using Python3 socket)

I'm having trouble how to structure a proper Game Server using python3 socket library. My game is a serverside game, where the client send basic commands to the server, which is interpreted and run by ...
1
vote
2answers
176 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 ...
2
votes
3answers
128 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 ...
1
vote
1answer
122 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. ...
1
vote
1answer
62 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. ...
1
vote
1answer
78 views

What are the limitations of WinSock2 sockets within threads?

So 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 ...
-2
votes
2answers
108 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, ...
-2
votes
1answer
72 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 ...
0
votes
1answer
110 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 ...
0
votes
2answers
101 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 ...
0
votes
2answers
270 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"...
3
votes
1answer
113 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 ...
0
votes
1answer
96 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 ...
0
votes
2answers
300 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)....
0
votes
1answer
218 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 ...
0
votes
0answers
115 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 ...
0
votes
1answer
2k 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 ...
0
votes
1answer
66 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 ...
0
votes
1answer
55 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(...
0
votes
1answer
228 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 ...
3
votes
0answers
422 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 ...
3
votes
3answers
4k 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 ...
1
vote
0answers
1k 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 ...
0
votes
1answer
2k 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(...
3
votes
1answer
1k 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: +------------+ | ...
1
vote
2answers
171 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 ...
2
votes
2answers
2k 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 ...
0
votes
1answer
876 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 ...
3
votes
2answers
424 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 ...
4
votes
1answer
828 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 ...
17
votes
2answers
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 ...
2
votes
2answers
134 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(...
1
vote
0answers
796 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....
2
votes
1answer
470 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 ...
2
votes
1answer
5k 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.
1
vote
2answers
51 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 ...
3
votes
4answers
617 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 ...
2
votes
1answer
902 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 ...
-6
votes
2answers
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 ...
1
vote
2answers
64 views

What is the best method for transfer wide range of data into another networked PC?

I have some network device(IOT) that contain temperature sensors to collect the temperature of milk mixing tanks and send that temperature to another networked computer.I have more than 100000 of ...
0
votes
1answer
61 views

For interaction by other programs: command line, sockets, or something else?

I'm beginning an open-source project for logging work hours. The intention is to build something similar to Git, where instead of pushing code you're pushing information about work hours and progress. ...
6
votes
0answers
709 views

Zeromq bidirectional asynchronous transmission?

I have a system which consists of two applications. Currently, two applications communicate using multiple zeromq publish/subscribe sockets generated for each specific type of transmission. Sockets ...