TeamSpeak-3-Java-API icon indicating copy to clipboard operation
TeamSpeak-3-Java-API copied to clipboard

Socket Timeout Exception: Read timed out

Open MartinWagenbach opened this issue 4 years ago • 2 comments

Guten Morgen,

ich habe das Problem, dass mein Bot nach einer gewissen Zeit die Verbindung verliert.

Mit freundlichem Gruß, Martin Wagenbach

Fehlermeldung

https://pastebin.com/uBK80vDk

Code

de.mimnu.daddeleckets3bot.support.SupportChannel: https://pastebin.com/HvZdHZ1D

de.mimnu.daddeleckets3bot.afkmover.AfkMover: https://pastebin.com/Hm0LBkix

MartinWagenbach avatar Nov 02 '20 07:11 MartinWagenbach

That's simply a timeout and doesn't give any further information about what went wrong. If you were connected on localhost a timeout really shouldn't happen, but still could.

Best thing you can do is add reconnect listeners to your bot to stop the Timer tasks after a disconnect happens, and after a successful reconnect restart them.

See this example: https://github.com/TheHolyWaffle/TeamSpeak-3-Java-API/blob/master/example/ReconnectExample.java

Kakifrucht avatar Nov 02 '20 18:11 Kakifrucht

Also provide code snippets as a gisthub gist so it does not invalidate after time. The pastebin links dont work anymore :)

Likqez avatar Nov 10 '20 17:11 Likqez