Вопрос

I am looking for an efficient way to feed a log file via the network (a demon of sorts). Each packet being a number of lines from the log file so that they can be processed from the other end. It is important for the server to be independent from the client meaning that it should be able to 'hold' the packets to be sent when the client is connected.

Note : I am aiming for a two-way communication, not a broadcast.

Это было полезно?

Решение

You could try using message queue middleware e.g. RabbitMQ. Its a nice way to decouple two systems like you describe. The message broker (RabbitMQ) will queue messages until the client/server connects and consumes them. You can have one queue for messages for the server and another queue for responses destined for the client. You could run RabbitMQ broker only on the server or you can have one on the client as well and shovel messages between them.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top