Skip to content

Autoconnect to Client everytime it opens #32

Description

@KruemelopmentDev

Hey guys,
I created a jar and turned it into an exe, starting when my PC boots. This is my connection code:

Client api = new ClientApi();
api.addClientConnectionListener(new ClientConnectionListener() {
    @Override
     public void onClientConnected() {
         infoLog("Client connected");
         connectSocket();
      }

      @Override
       public void onClientDisconnected() {
            infoLog("Client disconnected");
            socket.close();
        }
});

This code is called when the program starts. It should get when the client is available and connect with the websocket, if it fails first time then it should retry 4 times to connect the socket with a delay of 30 seconds after each try. Sometimes it does work sometimes it does not, do anybody maybe knows why? Is it a problem with the exe or inside the code?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions