simple-slack-api
simple-slack-api copied to clipboard
connect() freezes
I'm calling:
Session = SlackSessionFactory.createWebSocketSlackSession(token);
try {
Session.connect();
} catch (IOException e) {
e.printStackTrace();
Session = null;
}
But connect() never comes back... I step thru to the statement: websocketSession = client.connectToServer(new Endpoint() .... in SlackWebSocketSessionImpl.connectImpl()
I have no proxy. Why would it just hang and not return anything/fail?
Thx, Mark
Same issue here. Trying to debug
Interesting enough:
private static final String SLACK_HTTPS_AUTH_URL = "https://slack.com/api/rtm.start?token=";
public static void main(String [] args) throws IOException {
String authToken = "TOKEN";
HttpClient httpClient = HttpClientBuilder.create().build();
HttpGet request = new HttpGet(SLACK_HTTPS_AUTH_URL + authToken);
HttpResponse response;
response = httpClient.execute(request);
System.out.print(response.getStatusLine().getStatusCode());
}
actually works
Failure when running the connect from the library:
WARN [2017-03-30 16:32:59,605] io.split.qos.server.integrations.slack.SlackCommon: Could not create session with token XXXX, Slack Integration will not broadcast at all
! java.io.EOFException: SSL peer shut down incorrectly
! at sun.security.ssl.InputRecord.read(InputRecord.java:505) ~[na:1.8.0_51]
! at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:973) ~[na:1.8.0_51]
! ... 29 common frames omitted
! Causing: javax.net.ssl.SSLHandshakeException: Remote host closed connection during handshake
any news on that issue...?
I have the issue as well.
I also have this issue. I used it first on my Slack team that has a handful of users and it worked fine. I then tried to connect to a team that is much much bigger and it just hangs
I met a "solution" to this: I just have commented the call to establishWebsocketConnection() in the method connectImpl of the class SlackWebSocketSessionImpl.
Looking at the message history, it seems to be linked to the websocket connection. It can depends on your WebSocketContainer. With the actual information I have I can't give any further input nor provide a fix
The solution proposed by @Arkanute works! Thank you!
Have the same issue. Would it be possible to add a timeout value instead of letting the connection hang?