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

Sockets Seems not to Close #35

Open
pskondras opened this issue May 7, 2019 · 0 comments
Open

Sockets Seems not to Close #35

pskondras opened this issue May 7, 2019 · 0 comments

Comments

@pskondras
Copy link

pskondras commented May 7, 2019

Hi,I am using gpsd4java version 1.10.
I have the following probem.
It seems the sockets to the gpsd are not close when i call the stop() in the endpoint.
My procedure is the following.
If i don't get Gps data for a period of time i stop the endpoint and recreate it.
epoint.removeListener(objectListener);
epoint.stop();
epoint=null;
epoint = new GPSdEndpoint(host, port, new ResultParser());
AddGpsdListeners();
epoint.start();
epoint.version();
epoint.watch(true, true);
epoint.poll();

But wathing the sockets in the unix machine where my java app is running using
lsof -i -P |grep ProcessId
i see that almost each time the code recreates the end point a socket is left open.
Is this a knowh bug. How i can overcome it.
Some logs
07/May/2019 15:30:48- SocketThread: Problem encountered while reading/parsing/handling line, attempting restart
07/May/2019 15:30:48- SocketThread: Disconnected from GPS socket, retrying connection
07/May/2019 15:30:48- ResultParser: activated: 2019-05-07T12:30:47.866Z
07/May/2019 15:30:48- ResultParser: Date: Tuesday, May 7, 2019 3:30:47 PM EEST
07/May/2019 15:30:48- SocketThread: Connected to GPS socket
07/May/2019 15:30:50- SocketThread: Connecting to GPSD socket
07/May/2019 15:30:53- ResultParser: activated: 2019-05-07T12:30:52.869Z
07/May/2019 15:30:53- ResultParser: Date: Tuesday, May 7, 2019 3:30:52 PM EEST
07/May/2019 15:30:53- SocketThread: Connected to GPS socket

It seems that when the stop occurs at some specific time there is a retry in the SocketThread based on retryConnection timeout and then the start() comes again so one socket stays on.

Thanks in advance.

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

1 participant