Skip to content

Commit 050ee20

Browse files
committed
feat: 🎸 remove connection ID
1 parent 44ae4d4 commit 050ee20

File tree

3 files changed

+0
-13
lines changed

3 files changed

+0
-13
lines changed

src/server/http1/context.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@ import type {ConnectionContext} from '../types';
99
const rnd32BitUint = (): number => (Math.random() * 0xffffffff) >>> 0;
1010

1111
export class Http1ConnectionContext<Meta = Record<string, unknown>> implements ConnectionContext<Meta> {
12-
public id: number = rnd32BitUint();
13-
1412
constructor(
1513
public readonly req: http.IncomingMessage,
1614
public readonly res: http.ServerResponse,
@@ -33,8 +31,6 @@ export class Http1ConnectionContext<Meta = Record<string, unknown>> implements C
3331
}
3432

3533
export class WsConnectionContext<Meta = Record<string, unknown>> implements ConnectionContext<Meta> {
36-
public id: number = rnd32BitUint();
37-
3834
constructor(
3935
public readonly connection: WsServerConnection,
4036
public path: string,

src/server/http2/context.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,7 @@ import type {JsonValueCodec} from '@jsonjoy.com/json-pack/lib/codecs/types';
33
import type {RpcMessageCodec} from '../../common/codec/types';
44
import type {ConnectionContext} from '../types';
55

6-
const rnd32BitUint = (): number => (Math.random() * 0xffffffff) >>> 0;
7-
86
export class Http2ConnectionContext<Meta = Record<string, unknown>> implements ConnectionContext<Meta> {
9-
public readonly id: number = rnd32BitUint();
10-
117
constructor(
128
public readonly req: http.IncomingMessage,
139
public readonly res: http.ServerResponse,

src/server/types.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,6 @@ import type {JsonValueCodec} from '@jsonjoy.com/json-pack/lib/codecs/types';
22
import type {RpcMessageCodec} from '../common/codec/types';
33

44
export interface ConnectionContext<Meta = Record<string, unknown>> {
5-
/**
6-
* Random connection ID. A 32-bit unsigned integer. Can be used to identify a
7-
* connection, such as socket ID. For example, to not send back own messages.
8-
*/
9-
id: number;
105
path: string;
116
query: string;
127
ip: string;

0 commit comments

Comments
 (0)