Commit 669592d committed Oct 15, 2020 Verified
1 parent 2d2a31e commit 669592d Copy full SHA for 669592d
File tree 4 files changed +4
-48
lines changed
4 files changed +4
-48
lines changed Original file line number Diff line number Diff line change @@ -595,17 +595,6 @@ export class Server extends EventEmitter {
595
595
return this ;
596
596
}
597
597
598
- /**
599
- * Sets the binary flag
600
- *
601
- * @param {Boolean } binary - encode as if it has binary data if `true`, Encode as if it doesnt have binary data if `false`
602
- * @return {Server } self
603
- */
604
- public binary ( binary : boolean ) : Server {
605
- this . sockets . binary ( binary ) ;
606
- return this ;
607
- }
608
-
609
598
/**
610
599
* Sets a modifier for a subsequent event emission that the event data may be lost if the client is not ready to
611
600
* receive messages (because of network slowness or other issues, or because they’re connected through long polling
Original file line number Diff line number Diff line change @@ -3,7 +3,6 @@ import { Server } from "./index";
3
3
import { Client } from "./client" ;
4
4
import { EventEmitter } from "events" ;
5
5
import { PacketType } from "socket.io-parser" ;
6
- import hasBin from "has-binary2" ;
7
6
import debugModule from "debug" ;
8
7
import { Adapter , Room , SocketId } from "socket.io-adapter" ;
9
8
@@ -172,11 +171,7 @@ export class Namespace extends EventEmitter {
172
171
// set up packet object
173
172
args . unshift ( ev ) ;
174
173
const packet = {
175
- type : ( this . flags . binary !== undefined
176
- ? this . flags . binary
177
- : hasBin ( args ) )
178
- ? PacketType . BINARY_EVENT
179
- : PacketType . EVENT ,
174
+ type : PacketType . EVENT ,
180
175
data : args
181
176
} ;
182
177
@@ -248,17 +243,6 @@ export class Namespace extends EventEmitter {
248
243
return this ;
249
244
}
250
245
251
- /**
252
- * Sets the binary flag
253
- *
254
- * @param {Boolean } binary - encode as if it has binary data if `true`, Encode as if it doesnt have binary data if `false`
255
- * @return {Namespace } self
256
- */
257
- public binary ( binary : boolean ) : Namespace {
258
- this . flags . binary = binary ;
259
- return this ;
260
- }
261
-
262
246
/**
263
247
* Sets a modifier for a subsequent event emission that the event data may be lost if the client is not ready to
264
248
* receive messages (because of network slowness or other issues, or because they’re connected through long polling
Original file line number Diff line number Diff line change 1
1
import { EventEmitter } from "events" ;
2
2
import { PacketType } from "socket.io-parser" ;
3
- import hasBin from "has-binary2" ;
4
3
import url from "url" ;
5
4
import debugModule from "debug" ;
6
5
import { Server } from "./index" ;
@@ -136,11 +135,7 @@ export class Socket extends EventEmitter {
136
135
}
137
136
args . unshift ( ev ) ;
138
137
const packet : any = {
139
- type : ( this . flags . binary !== undefined
140
- ? this . flags . binary
141
- : hasBin ( args ) )
142
- ? PacketType . BINARY_EVENT
143
- : PacketType . EVENT ,
138
+ type : PacketType . EVENT ,
144
139
data : args
145
140
} ;
146
141
@@ -356,7 +351,7 @@ export class Socket extends EventEmitter {
356
351
357
352
self . packet ( {
358
353
id : id ,
359
- type : hasBin ( args ) ? PacketType . BINARY_ACK : PacketType . ACK ,
354
+ type : PacketType . ACK ,
360
355
data : args
361
356
} ) ;
362
357
@@ -460,17 +455,6 @@ export class Socket extends EventEmitter {
460
455
return this ;
461
456
}
462
457
463
- /**
464
- * Sets the binary flag
465
- *
466
- * @param {Boolean } binary - encode as if it has binary data if `true`, Encode as if it doesnt have binary data if `false`
467
- * @return {Socket } self
468
- */
469
- public binary ( binary : boolean ) : Socket {
470
- this . flags . binary = binary ;
471
- return this ;
472
- }
473
-
474
458
/**
475
459
* Sets a modifier for a subsequent event emission that the event data may be lost if the client is not ready to
476
460
* receive messages (because of network slowness or other issues, or because they’re connected through long polling
Original file line number Diff line number Diff line change 37
37
"base64id" : " ~2.0.0" ,
38
38
"debug" : " ~4.1.0" ,
39
39
"engine.io" : " ~4.0.0" ,
40
- "has-binary2" : " ~1.0.2" ,
41
40
"socket.io-adapter" : " ~2.0.1" ,
42
41
"socket.io-client" : " 3.0.0-rc1" ,
43
- "socket.io-parser" : " 4.0.1-rc1 "
42
+ "socket.io-parser" : " 4.0.1-rc2 "
44
43
},
45
44
"devDependencies" : {
46
45
"@types/cookie" : " ^0.4.0" ,
You can’t perform that action at this time.
0 commit comments