File tree 1 file changed +8
-3
lines changed
src/main/java/com/ning/http/client/providers/netty 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change 19
19
import com .ning .http .client .websocket .WebSocketTextListener ;
20
20
import org .jboss .netty .channel .Channel ;
21
21
import org .jboss .netty .handler .codec .http .websocketx .BinaryWebSocketFrame ;
22
+ import org .jboss .netty .handler .codec .http .websocketx .CloseWebSocketFrame ;
22
23
import org .jboss .netty .handler .codec .http .websocketx .PingWebSocketFrame ;
23
24
import org .jboss .netty .handler .codec .http .websocketx .PongWebSocketFrame ;
24
25
import org .jboss .netty .handler .codec .http .websocketx .TextWebSocketFrame ;
25
26
import org .slf4j .Logger ;
26
27
import org .slf4j .LoggerFactory ;
27
28
28
- import java .util .concurrent .ConcurrentLinkedQueue ;
29
-
30
29
import java .io .ByteArrayOutputStream ;
30
+ import java .util .concurrent .ConcurrentLinkedQueue ;
31
31
32
32
import static org .jboss .netty .buffer .ChannelBuffers .wrappedBuffer ;
33
33
@@ -116,7 +116,12 @@ public boolean isOpen() {
116
116
public void close () {
117
117
onClose ();
118
118
listeners .clear ();
119
- channel .close ();
119
+ try {
120
+ channel .write (new CloseWebSocketFrame ());
121
+ channel .getCloseFuture ().awaitUninterruptibly ();
122
+ } finally {
123
+ channel .close ();
124
+ }
120
125
}
121
126
122
127
protected void onBinaryFragment (byte [] message , boolean last ) {
You can’t perform that action at this time.
0 commit comments