EventBus icon indicating copy to clipboard operation
EventBus copied to clipboard

Code crash when publishing in a case of server/client eventBus

Open CriJonsi opened this issue 6 years ago • 1 comments

Hi! My issue is the following: I'm currently implementing a connection between 2 different code into the same computer. So I have a server and a client. I run the server and then the client. Then the server publish events which are read and execute by the client. But when I stop the clients code the server code is crashing.

After test and investigations I found that the subscribers map[string][]*SubscribeArg map from the server object is not updated when the client is disconnected. If the client is not working any more the subscribers object is always the same.

So when I'm using server.HasClientSubscribed(&theArgs) its responding always true event after the disconnection of the client.

My workaround is to use: rpcClient, _ := rpc.DialHTTPPath("tcp", ":2010", "/_client_bus_") and check if it not nil before to make a publish

Is there a solution in order to update this map? Is there any another solution in order to avoid the crash of the code?

Best regards !

CriJonsi avatar Jan 03 '18 16:01 CriJonsi

Still happens with latest versions 3 years later.

fgm avatar Jan 07 '21 17:01 fgm