M
M
meforyou2016-03-20 00:49:24
Java
meforyou, 2016-03-20 00:49:24

How to manage traffic in Java?

Hello!
I have my thesis, its essence is to create a network balancer.
All client requests to servers will go through the balancing server, the response from the servers too.
The essence of the work is that the balancer knows in advance which server is less loaded and redirects the client's data to the server, as well as sends the server's response to the desired client.
How can you manage traffic from the server to the client and vice versa, and what programming languages ​​allow you to do this? And also, if not difficult, tell me some articles, materials of a similar development.
Everything must be written by yourself. Thanks in advance. :)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey Gornostaev, 2016-03-20
@meforyou

This can be done in any programming language.
Keep in memory an array of server addresses and a variable with the index of the server to which you want to send the next request. When a new request is received, select the server address from the array, redirect the request to it, increase the variable by one. If the value of the variable has become larger than the length of the array, reset it to zero. You get a classic round-robin.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question