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