Atmosphere / wasync

WebSockets with fallback transports client library for Node.js, Android and Java
http://async-io.org
161 stars 47 forks source link

Wasync Unable to fire inside socket after ws reconnection #144

Closed fstn closed 7 years ago

fstn commented 7 years ago

Hi,

I'm unable to fire inside WS after socket reconnection: `

Caused by: com.*****.ws.network.exception.UnableToWriteInsideResourceWSException: java.io.IOException: Invalid Socket Status REOPENED
    at com.*****.ws.network.model.resource.Resource.write(Resource.java:88)
    at com.*****.ws.network.model.resource.Resource.write(Resource.java:70)
    at com.*****.ws.network.model.resource.Resource.write(Resource.java:58)
    at com.*****.OpenCloseOpenTest.sendTestMessage(OpenCloseOpenTest.java:70)
    at com.*****.OpenCloseOpenTest.test(OpenCloseOpenTest.java:59)
    ... 22 more
Caused by: java.io.IOException: Invalid Socket Status REOPENED
    at org.atmosphere.wasync.impl.DefaultSocket.fire(DefaultSocket.java:78)
    at com.*****.ws.network.model.resource.Resource.write(Resource.java:86)
    at com.*****.ws.network.model.resource.Resource.write(Resource.java:70)
    at com.*****.ws.network.model.resource.Resource.write(Resource.java:58)
    at com.*****.OpenCloseOpenTest.sendTestMessage(OpenCloseOpenTest.java:70)
    at com.*****.OpenCloseOpenTest.test(OpenCloseOpenTest.java:49)

` when trying to do:

`

final RequestBuilder request = client.newRequestBuilder()
     .decoder(new PacketDecoder())
     .encoder(new PacketEncoder())
     .method(Request.METHOD.GET)
     .uri("http://127.0.0.1:" + currentConfig.getDestPort() + path)
     .transport(Request.TRANSPORT.WEBSOCKET);

final OptionsBuilder optionsBuilder = client.newOptionsBuilder()
    .requestTimeoutInSeconds(120)
    .reconnectAttempts(100)
    .pauseBeforeReconnectInSeconds(1)
    .reconnect(true);

socket = client.create(new DefaultOptions(optionsBuilder));

` Socket: image

image

My pom.xml: `

<dependency>
    <groupId>org.atmosphere</groupId>
    <artifactId>nettosphere</artifactId>
    <version>2.4.5</version>
</dependency>
<dependency>
    <groupId>org.atmosphere</groupId>
    <artifactId>wasync</artifactId>
    <version>2.1.2</version>
</dependency>
<dependency>
    <groupId>org.atmosphere</groupId>
    <artifactId>atmosphere-runtime</artifactId>
    <version>2.4.5</version>
</dependency>
<dependency>
    <groupId>org.atmosphere</groupId>
    <artifactId>atmosphere-spring</artifactId>
    <version>RELEASE</version>
</dependency>
<dependency>
    <groupId>org.apache.commons</groupId>
    <artifactId>commons-lang3</artifactId>
    <version>3.4</version>
</dependency>
<dependency>
    <groupId>org.apache.httpcomponents</groupId>
    <artifactId>httpclient</artifactId>
    <version>4.4.1</version>
</dependency>
<dependency>
    <groupId>ch.qos.logback</groupId>
    <artifactId>logback-classic</artifactId>
    <version>1.1.5</version>
</dependency>

<dependency>
    <groupId>ch.qos.logback</groupId>
    <artifactId>logback-core</artifactId>
    <version>1.1.5</version>
</dependency>
<dependency>
    <groupId>com.nimbusds</groupId>
    <artifactId>nimbus-jose-jwt</artifactId>
    <version>3.8</version>
</dependency>

`

Any ideas?

fstn commented 7 years ago

ok updated to atmosphere 2.4.9 and wasync to 2.1.3 and it works now