Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [sockets]

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

-2
votes
0answers
41 views

How to create a Realtime Cricket Score Update Server for Android [on hold]

I want to create a Cricket Live Score Update Server for my Android Application. I already have a server which is done by Spring Boot and Nginx. So my basic is, from my server i will publish the ...
0
votes
1answer
38 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
37 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
219 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 ...
2
votes
0answers
241 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 ...
0
votes
0answers
211 views

Multi-threaded socket chat server design

I've a general question about the design of a multi-threaded chat server application written in Java. At the moment I've the following structure: ConnectionController class which handles the I/O ...
2
votes
3answers
873 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
589 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
917 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(...
2
votes
1answer
519 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: +------------+ | ...
2
votes
2answers
162 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
936 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
494 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
260 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 ...
5
votes
1answer
281 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
5k 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 ...
3
votes
2answers
128 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
642 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
346 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 ...
0
votes
0answers
32 views

Workflow to access shared structs in networking

I want to find an example in UNIX socket programming or in general networking applications where the following situation is common: Consider three request threads T1,T2,T3 and a manager thread T. ...
1
vote
1answer
1k 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
47 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
405 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
665 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
971 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
62 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
57 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. ...
5
votes
0answers
539 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 ...
6
votes
2answers
667 views

How to handle thousands of messages to C socket?

I currently have a setup looking like this: __________________ _________ ________ ___________ | Front end server |----| Varnish |----| NodeJS |----| C-service | ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾ ...
-1
votes
1answer
51 views

Language cross platform that allows different socks connection per thread

Hello i'm developing an app that needs to do many requests with different socks connections. I was doing it in C# but i'm not sure how well it will work on a linux server even with .net core . Java ...
2
votes
1answer
411 views

Designing a program that runs scripts on multiple computers (Java)

I've been trying to design a program in Java (because I might need to create an app that does the controlling part) with GUI that can run scripts on a few local computers. It should do the following: ...
0
votes
0answers
192 views

Concept analysis: using a Java ServerSocket to let an Android phone and server communicate?

I have an idea for an application that will not be published to the public Play Store. My friends will need to be able to log in from their Android phone to view certain data that cannot be viewed by ...
1
vote
1answer
617 views

Asynchronous client-server implementation

The mission: Implement a program that will listen to multiple client requests asynchronously (on TCP) and transfer them to a server (also on TCP) to which only one connection is allowed. The program ...
0
votes
1answer
34 views

Keeping deploys in Sync

I plan to have a web server, which will serve JavaScript used to make connections, and a socket server which the javascript will talk to. How can I make sure that when deploying a new update, the ...
1
vote
1answer
95 views

Recieving errors without engaging in excessive communication when using sockets

I'm currently writing a program that communicates with a server over TCP sockets. I originally planned for the communication to include a message confirming successful communication at the end of ...
-1
votes
1answer
402 views

SDL_net how to get the UDP remote address? [closed]

I have a problem with the tcp and udp synchronization. On the server it accepted the tcp connection with the: SDLNet_TCP_Accept(); But now I need to know how to get the remote address of the ...
3
votes
1answer
124 views

How to handle a client app that connects to a TCP server and sends/receives text data bidirectionally?

I've got a conceptual question (which is probably better posted here than on StackOverflow?). I want to develop a client application that maintains a persistent connection to a server, and exchanges ...
1
vote
1answer
49 views

Architecture/technology for implementing Management console [closed]

I'm having a distributed environment which include several machines under the same network , which are being controlled by another computer in another network which is also running a UI for doing the ...
0
votes
0answers
266 views

Monitoring interfaces and subscribing to multicast on them

How can a program enumerate the available IP interfaces, and monitor changes in them, to subscribe to and send IP multicasts on all of them? I ask because I am troubleshooting a problem with the ...
0
votes
1answer
508 views

Why can't socket-communication use process_id instead of port_number? [closed]

nowadays, I am studying OS. In Communication in Client-Server Systems chapter, I've heard that using process-id instead of port-number has problems. But I don't understand why it does. I think ...
7
votes
5answers
1k views

How do I balance 100 clients checking the same database table in a loop?

What I have This is a prototype. I have a pool of 100 clients connected to the server via websockets reporting things and awaiting for commands. The server polls the commands database table of type ...
1
vote
2answers
5k views

How does the communication between a chat server and client work?

(Socket programming newbie here...) So, for learning purposes I've just started developing a chat server and client in Python, and I was wondering how it is usually implemented. When someone ...
3
votes
1answer
252 views

Is TCP still considered siginificant overhead compared to UDP? [closed]

I'm working on a distributed application for a graduate class I'm taking. There has been much discussion around implementing a way to maintain peer connection health statuses. Think Gossip. One of the ...
3
votes
1answer
1k views

Design pattern for socket.io and Express

I have a Node.js Express RESTful HTTP server I will call server A and an Express socket.io server I will call server B. Server A responds to all HTTP requests by clients and server B listens to the ...
3
votes
1answer
101 views

Is web sockets the best solution for my problem?

I have created a Slackbot that integrates with Submittable.com. For example, I can trigger a response that displays all current submissions in Slack. I now need my Slackbot to post in Slack whenever ...
0
votes
1answer
651 views

Can I listen on a port without interrupting traffic?

I have developed the bare bones on a socket server in Python. I'm trying to capture the HTTP packets going to a web server without blocking them. try: self.socket = socket.socket(socket....
1
vote
2answers
2k views

What is a good way for Tomcat to interact with another Java application running on the local machine

I'm new to using Java within a web environment. At the moment I have a Java application that we run on a local machine, we'll call it the server app. We want to add the ability to communicate with ...
3
votes
1answer
241 views

Design approach to outsourcing a socket in an own thread

I want to extend an existing server written in C++ to be able to communicate with an other server over websockets (e.g. logging or user authorisation purposes). All examples (including the very well ...
7
votes
1answer
921 views

Does it ever make sense to read from and/or write to a bound, listening socket?

I'm experimenting a little with creating a socket server, in PHP. In doing so I'm trying to abstract away the kinds of sockets I think I'll be needing, that I've tentitively named: ListenSocket — the ...
0
votes
1answer
828 views

Limitations of modern programming languages for low-level network programming [closed]

For say a network packet sniffer, are there any of the more modern high level languages such as C# or Java, that would actually be unsuitable or limiting when it would come to constructing a packet ...