Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
CriJonsi opened this issue Jan 3, 2018 · 1 comment
Open

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

CriJonsi opened this issue Jan 3, 2018 · 1 comment

Comments

@CriJonsi
Copy link
Contributor

CriJonsi commented Jan 3, 2018

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 !

@fgm
Copy link

fgm commented Jan 7, 2021

Still happens with latest versions 3 years later.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants