File tree Expand file tree Collapse file tree 3 files changed +6
-20
lines changed
Expand file tree Collapse file tree 3 files changed +6
-20
lines changed Original file line number Diff line number Diff line change @@ -149,10 +149,8 @@ public Manager(URI uri, Options opts) {
149149 this .uri = uri ;
150150 this .encoding = false ;
151151 this .packetBuffer = new ArrayList <Packet >();
152-
153- Parser parser = opts .parser != null ? opts .parser : new IOParser ();
154- this .encoder = parser .getEncoder ();
155- this .decoder = parser .getDecoder ();
152+ this .encoder = opts .encoder != null ? opts .encoder : new IOParser .Encoder ();
153+ this .decoder = opts .decoder != null ? opts .decoder : new IOParser .Decoder ();
156154 }
157155
158156 private void emitAll (String event , Object ... args ) {
@@ -634,7 +632,8 @@ public static class Options extends io.socket.engineio.client.Socket.Options {
634632 public long reconnectionDelay ;
635633 public long reconnectionDelayMax ;
636634 public double randomizationFactor ;
637- public Parser parser ;
635+ public Parser .Encoder encoder ;
636+ public Parser .Decoder decoder ;
638637
639638 /**
640639 * Connection timeout (ms). Set -1 to disable.
Original file line number Diff line number Diff line change 11package io .socket .parser ;
22
3+ import io .socket .client .IO ;
34import io .socket .hasbinary .HasBinary ;
45import org .json .JSONException ;
56import org .json .JSONTokener ;
@@ -18,17 +19,7 @@ private static Packet<String> error() {
1819 return new Packet <String >(ERROR , "parser error" );
1920 }
2021
21- public IOParser () {}
22-
23- @ Override
24- public Parser .Encoder getEncoder () {
25- return new Encoder ();
26- }
27-
28- @ Override
29- public Parser .Decoder getDecoder () {
30- return new Decoder ();
31- }
22+ private IOParser () {}
3223
3324 final public static class Encoder implements Parser .Encoder {
3425
Original file line number Diff line number Diff line change @@ -63,10 +63,6 @@ public interface Parser {
6363 "BINARY_ACK"
6464 };
6565
66- public Encoder getEncoder ();
67-
68- public Decoder getDecoder ();
69-
7066 public static interface Encoder {
7167
7268 public void encode (Packet obj , Callback callback );
You can’t perform that action at this time.
0 commit comments