@webvpn/dgram 0.0.1 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (91) hide show
  1. package/build/index.cjs +2235 -2327
  2. package/build/index.cjs.map +1 -1
  3. package/build/index.d.ts +5 -184
  4. package/build/index.js +10094 -2664
  5. package/build/index.js.map +1 -1
  6. package/package.json +4 -6
  7. package/src/index.ts +5 -698
  8. package/vite-plugin-node-stdlib-browser.cjs +61 -61
  9. package/vite.config.ts +29 -29
  10. package/build/index.mjs +0 -3252
  11. package/build/index.mjs.map +0 -1
  12. package/build/test.d.ts +0 -1
  13. package/build/utils.d.ts +0 -13
  14. package/index.html +0 -11
  15. package/src/chrome-dgram.js +0 -503
  16. package/src/flatbuffers/client-packet-type.ts +0 -40
  17. package/src/flatbuffers/client-packet.ts +0 -162
  18. package/src/flatbuffers/client-tcpserver-close.ts +0 -93
  19. package/src/flatbuffers/client-tcpserver-get-connections.ts +0 -93
  20. package/src/flatbuffers/client-tcpserver-listen.ts +0 -211
  21. package/src/flatbuffers/client-tcpserver.ts +0 -159
  22. package/src/flatbuffers/client-tcpsocket-connect.ts +0 -253
  23. package/src/flatbuffers/client-tcpsocket-destroy-soon.ts +0 -75
  24. package/src/flatbuffers/client-tcpsocket-destroy.ts +0 -93
  25. package/src/flatbuffers/client-tcpsocket-end.ts +0 -93
  26. package/src/flatbuffers/client-tcpsocket-pause.ts +0 -75
  27. package/src/flatbuffers/client-tcpsocket-reset-and-destroy.ts +0 -75
  28. package/src/flatbuffers/client-tcpsocket-resume.ts +0 -75
  29. package/src/flatbuffers/client-tcpsocket-set-encoding.ts +0 -93
  30. package/src/flatbuffers/client-tcpsocket-set-keep-alive.ts +0 -103
  31. package/src/flatbuffers/client-tcpsocket-set-no-delay.ts +0 -89
  32. package/src/flatbuffers/client-tcpsocket-set-timeout.ts +0 -107
  33. package/src/flatbuffers/client-tcpsocket-write.ts +0 -147
  34. package/src/flatbuffers/client-tcpsocket.ts +0 -89
  35. package/src/flatbuffers/client-udpsocket-add-membership.ts +0 -110
  36. package/src/flatbuffers/client-udpsocket-add-source-specific-membership.ts +0 -127
  37. package/src/flatbuffers/client-udpsocket-bind.ts +0 -138
  38. package/src/flatbuffers/client-udpsocket-close.ts +0 -93
  39. package/src/flatbuffers/client-udpsocket-disconnect.ts +0 -75
  40. package/src/flatbuffers/client-udpsocket-drop-membership.ts +0 -110
  41. package/src/flatbuffers/client-udpsocket-drop-source-specific-membership.ts +0 -127
  42. package/src/flatbuffers/client-udpsocket-send.ts +0 -189
  43. package/src/flatbuffers/client-udpsocket-set-broadcast.ts +0 -89
  44. package/src/flatbuffers/client-udpsocket-set-multicast-interface.ts +0 -93
  45. package/src/flatbuffers/client-udpsocket-set-multicast-loopback.ts +0 -89
  46. package/src/flatbuffers/client-udpsocket-set-multicast-ttl.ts +0 -89
  47. package/src/flatbuffers/client-udpsocket-set-recv-buffer-size.ts +0 -89
  48. package/src/flatbuffers/client-udpsocket-set-send-buffer-size.ts +0 -89
  49. package/src/flatbuffers/client-udpsocket-set-ttl.ts +0 -89
  50. package/src/flatbuffers/client-udpsocket.ts +0 -149
  51. package/src/flatbuffers/packet-handshake-type.ts +0 -9
  52. package/src/flatbuffers/packet.ts +0 -210
  53. package/src/flatbuffers/schema.ts +0 -75
  54. package/src/flatbuffers/server-packet-type.ts +0 -38
  55. package/src/flatbuffers/server-packet.ts +0 -158
  56. package/src/flatbuffers/server-tcpserver-callback-close.ts +0 -93
  57. package/src/flatbuffers/server-tcpserver-callback-get-connections.ts +0 -124
  58. package/src/flatbuffers/server-tcpserver-callback-listen.ts +0 -141
  59. package/src/flatbuffers/server-tcpserver-event-close.ts +0 -75
  60. package/src/flatbuffers/server-tcpserver-event-drop.ts +0 -75
  61. package/src/flatbuffers/server-tcpserver-event-error.ts +0 -75
  62. package/src/flatbuffers/server-tcpserver-event-listening.ts +0 -124
  63. package/src/flatbuffers/server-tcpsocket-callback-connect.ts +0 -189
  64. package/src/flatbuffers/server-tcpsocket-callback-end.ts +0 -93
  65. package/src/flatbuffers/server-tcpsocket-callback-set-timeout.ts +0 -93
  66. package/src/flatbuffers/server-tcpsocket-callback-write.ts +0 -93
  67. package/src/flatbuffers/server-tcpsocket-event-close.ts +0 -89
  68. package/src/flatbuffers/server-tcpsocket-event-connect.ts +0 -172
  69. package/src/flatbuffers/server-tcpsocket-event-connection-attempt-failed.ts +0 -138
  70. package/src/flatbuffers/server-tcpsocket-event-connection-attempt-timeout.ts +0 -121
  71. package/src/flatbuffers/server-tcpsocket-event-connection-attempt.ts +0 -121
  72. package/src/flatbuffers/server-tcpsocket-event-data.ts +0 -113
  73. package/src/flatbuffers/server-tcpsocket-event-drain.ts +0 -75
  74. package/src/flatbuffers/server-tcpsocket-event-end.ts +0 -75
  75. package/src/flatbuffers/server-tcpsocket-event-error.ts +0 -93
  76. package/src/flatbuffers/server-tcpsocket-event-lookup.ts +0 -141
  77. package/src/flatbuffers/server-tcpsocket-event-ready.ts +0 -75
  78. package/src/flatbuffers/server-tcpsocket-event-timeout.ts +0 -75
  79. package/src/flatbuffers/server-udpsocket-callback-bind.ts +0 -141
  80. package/src/flatbuffers/server-udpsocket-callback-close.ts +0 -93
  81. package/src/flatbuffers/server-udpsocket-callback-connect.ts +0 -141
  82. package/src/flatbuffers/server-udpsocket-callback-send.ts +0 -93
  83. package/src/flatbuffers/server-udpsocket-event-close.ts +0 -75
  84. package/src/flatbuffers/server-udpsocket-event-connect.ts +0 -75
  85. package/src/flatbuffers/server-udpsocket-event-error.ts +0 -93
  86. package/src/flatbuffers/server-udpsocket-event-listening.ts +0 -124
  87. package/src/flatbuffers/server-udpsocket-event-message.ts +0 -175
  88. package/src/net.js +0 -2442
  89. package/src/test.ts +0 -34
  90. package/src/types.ts +0 -16
  91. package/src/utils.ts +0 -45
@@ -1,147 +0,0 @@
1
- // automatically generated by the FlatBuffers compiler, do not modify
2
-
3
- /* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */
4
-
5
- import * as flatbuffers from 'flatbuffers';
6
-
7
- import { ClientPacketType } from './client-packet-type.js';
8
-
9
-
10
- export class ClientTCPSocketWrite implements flatbuffers.IUnpackableObject<ClientTCPSocketWriteT> {
11
- bb: flatbuffers.ByteBuffer|null = null;
12
- bb_pos = 0;
13
- __init(i:number, bb:flatbuffers.ByteBuffer):ClientTCPSocketWrite {
14
- this.bb_pos = i;
15
- this.bb = bb;
16
- return this;
17
- }
18
-
19
- static getRootAsClientTCPSocketWrite(bb:flatbuffers.ByteBuffer, obj?:ClientTCPSocketWrite):ClientTCPSocketWrite {
20
- return (obj || new ClientTCPSocketWrite()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
21
- }
22
-
23
- static getSizePrefixedRootAsClientTCPSocketWrite(bb:flatbuffers.ByteBuffer, obj?:ClientTCPSocketWrite):ClientTCPSocketWrite {
24
- bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);
25
- return (obj || new ClientTCPSocketWrite()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
26
- }
27
-
28
- type():ClientPacketType {
29
- const offset = this.bb!.__offset(this.bb_pos, 4);
30
- return offset ? this.bb!.readInt8(this.bb_pos + offset) : ClientPacketType.TCPSocket;
31
- }
32
-
33
- uuid():string|null
34
- uuid(optionalEncoding:flatbuffers.Encoding):string|Uint8Array|null
35
- uuid(optionalEncoding?:any):string|Uint8Array|null {
36
- const offset = this.bb!.__offset(this.bb_pos, 6);
37
- return offset ? this.bb!.__string(this.bb_pos + offset, optionalEncoding) : null;
38
- }
39
-
40
- data(index: number):number|null {
41
- const offset = this.bb!.__offset(this.bb_pos, 8);
42
- return offset ? this.bb!.readUint8(this.bb!.__vector(this.bb_pos + offset) + index) : 0;
43
- }
44
-
45
- dataLength():number {
46
- const offset = this.bb!.__offset(this.bb_pos, 8);
47
- return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;
48
- }
49
-
50
- dataArray():Uint8Array|null {
51
- const offset = this.bb!.__offset(this.bb_pos, 8);
52
- return offset ? new Uint8Array(this.bb!.bytes().buffer, this.bb!.bytes().byteOffset + this.bb!.__vector(this.bb_pos + offset), this.bb!.__vector_len(this.bb_pos + offset)) : null;
53
- }
54
-
55
- encoding():string|null
56
- encoding(optionalEncoding:flatbuffers.Encoding):string|Uint8Array|null
57
- encoding(optionalEncoding?:any):string|Uint8Array|null {
58
- const offset = this.bb!.__offset(this.bb_pos, 10);
59
- return offset ? this.bb!.__string(this.bb_pos + offset, optionalEncoding) : null;
60
- }
61
-
62
- static startClientTCPSocketWrite(builder:flatbuffers.Builder) {
63
- builder.startObject(4);
64
- }
65
-
66
- static addType(builder:flatbuffers.Builder, type:ClientPacketType) {
67
- builder.addFieldInt8(0, type, ClientPacketType.TCPSocket);
68
- }
69
-
70
- static addUuid(builder:flatbuffers.Builder, uuidOffset:flatbuffers.Offset) {
71
- builder.addFieldOffset(1, uuidOffset, 0);
72
- }
73
-
74
- static addData(builder:flatbuffers.Builder, dataOffset:flatbuffers.Offset) {
75
- builder.addFieldOffset(2, dataOffset, 0);
76
- }
77
-
78
- static createDataVector(builder:flatbuffers.Builder, data:number[]|Uint8Array):flatbuffers.Offset {
79
- builder.startVector(1, data.length, 1);
80
- for (let i = data.length - 1; i >= 0; i--) {
81
- builder.addInt8(data[i]!);
82
- }
83
- return builder.endVector();
84
- }
85
-
86
- static startDataVector(builder:flatbuffers.Builder, numElems:number) {
87
- builder.startVector(1, numElems, 1);
88
- }
89
-
90
- static addEncoding(builder:flatbuffers.Builder, encodingOffset:flatbuffers.Offset) {
91
- builder.addFieldOffset(3, encodingOffset, 0);
92
- }
93
-
94
- static endClientTCPSocketWrite(builder:flatbuffers.Builder):flatbuffers.Offset {
95
- const offset = builder.endObject();
96
- return offset;
97
- }
98
-
99
- static createClientTCPSocketWrite(builder:flatbuffers.Builder, type:ClientPacketType, uuidOffset:flatbuffers.Offset, dataOffset:flatbuffers.Offset, encodingOffset:flatbuffers.Offset):flatbuffers.Offset {
100
- ClientTCPSocketWrite.startClientTCPSocketWrite(builder);
101
- ClientTCPSocketWrite.addType(builder, type);
102
- ClientTCPSocketWrite.addUuid(builder, uuidOffset);
103
- ClientTCPSocketWrite.addData(builder, dataOffset);
104
- ClientTCPSocketWrite.addEncoding(builder, encodingOffset);
105
- return ClientTCPSocketWrite.endClientTCPSocketWrite(builder);
106
- }
107
-
108
- unpack(): ClientTCPSocketWriteT {
109
- return new ClientTCPSocketWriteT(
110
- this.type(),
111
- this.uuid(),
112
- this.bb!.createScalarList<number>(this.data.bind(this), this.dataLength()),
113
- this.encoding()
114
- );
115
- }
116
-
117
-
118
- unpackTo(_o: ClientTCPSocketWriteT): void {
119
- _o.type = this.type();
120
- _o.uuid = this.uuid();
121
- _o.data = this.bb!.createScalarList<number>(this.data.bind(this), this.dataLength());
122
- _o.encoding = this.encoding();
123
- }
124
- }
125
-
126
- export class ClientTCPSocketWriteT implements flatbuffers.IGeneratedObject {
127
- constructor(
128
- public type: ClientPacketType = ClientPacketType.TCPSocket,
129
- public uuid: string|Uint8Array|null = null,
130
- public data: (number)[] = [],
131
- public encoding: string|Uint8Array|null = null
132
- ){}
133
-
134
-
135
- pack(builder:flatbuffers.Builder): flatbuffers.Offset {
136
- const uuid = (this.uuid !== null ? builder.createString(this.uuid!) : 0);
137
- const data = ClientTCPSocketWrite.createDataVector(builder, this.data);
138
- const encoding = (this.encoding !== null ? builder.createString(this.encoding!) : 0);
139
-
140
- return ClientTCPSocketWrite.createClientTCPSocketWrite(builder,
141
- this.type,
142
- uuid,
143
- data,
144
- encoding
145
- );
146
- }
147
- }
@@ -1,89 +0,0 @@
1
- // automatically generated by the FlatBuffers compiler, do not modify
2
-
3
- /* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */
4
-
5
- import * as flatbuffers from 'flatbuffers';
6
-
7
- import { ClientPacketType } from './client-packet-type.js';
8
-
9
-
10
- export class ClientTCPSocket implements flatbuffers.IUnpackableObject<ClientTCPSocketT> {
11
- bb: flatbuffers.ByteBuffer|null = null;
12
- bb_pos = 0;
13
- __init(i:number, bb:flatbuffers.ByteBuffer):ClientTCPSocket {
14
- this.bb_pos = i;
15
- this.bb = bb;
16
- return this;
17
- }
18
-
19
- static getRootAsClientTCPSocket(bb:flatbuffers.ByteBuffer, obj?:ClientTCPSocket):ClientTCPSocket {
20
- return (obj || new ClientTCPSocket()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
21
- }
22
-
23
- static getSizePrefixedRootAsClientTCPSocket(bb:flatbuffers.ByteBuffer, obj?:ClientTCPSocket):ClientTCPSocket {
24
- bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);
25
- return (obj || new ClientTCPSocket()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
26
- }
27
-
28
- type():ClientPacketType {
29
- const offset = this.bb!.__offset(this.bb_pos, 4);
30
- return offset ? this.bb!.readInt8(this.bb_pos + offset) : ClientPacketType.TCPSocket;
31
- }
32
-
33
- allowHalfOpen():boolean {
34
- const offset = this.bb!.__offset(this.bb_pos, 6);
35
- return offset ? !!this.bb!.readInt8(this.bb_pos + offset) : false;
36
- }
37
-
38
- static startClientTCPSocket(builder:flatbuffers.Builder) {
39
- builder.startObject(2);
40
- }
41
-
42
- static addType(builder:flatbuffers.Builder, type:ClientPacketType) {
43
- builder.addFieldInt8(0, type, ClientPacketType.TCPSocket);
44
- }
45
-
46
- static addAllowHalfOpen(builder:flatbuffers.Builder, allowHalfOpen:boolean) {
47
- builder.addFieldInt8(1, +allowHalfOpen, +false);
48
- }
49
-
50
- static endClientTCPSocket(builder:flatbuffers.Builder):flatbuffers.Offset {
51
- const offset = builder.endObject();
52
- return offset;
53
- }
54
-
55
- static createClientTCPSocket(builder:flatbuffers.Builder, type:ClientPacketType, allowHalfOpen:boolean):flatbuffers.Offset {
56
- ClientTCPSocket.startClientTCPSocket(builder);
57
- ClientTCPSocket.addType(builder, type);
58
- ClientTCPSocket.addAllowHalfOpen(builder, allowHalfOpen);
59
- return ClientTCPSocket.endClientTCPSocket(builder);
60
- }
61
-
62
- unpack(): ClientTCPSocketT {
63
- return new ClientTCPSocketT(
64
- this.type(),
65
- this.allowHalfOpen()
66
- );
67
- }
68
-
69
-
70
- unpackTo(_o: ClientTCPSocketT): void {
71
- _o.type = this.type();
72
- _o.allowHalfOpen = this.allowHalfOpen();
73
- }
74
- }
75
-
76
- export class ClientTCPSocketT implements flatbuffers.IGeneratedObject {
77
- constructor(
78
- public type: ClientPacketType = ClientPacketType.TCPSocket,
79
- public allowHalfOpen: boolean = false
80
- ){}
81
-
82
-
83
- pack(builder:flatbuffers.Builder): flatbuffers.Offset {
84
- return ClientTCPSocket.createClientTCPSocket(builder,
85
- this.type,
86
- this.allowHalfOpen
87
- );
88
- }
89
- }
@@ -1,110 +0,0 @@
1
- // automatically generated by the FlatBuffers compiler, do not modify
2
-
3
- /* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */
4
-
5
- import * as flatbuffers from 'flatbuffers';
6
-
7
- import { ClientPacketType } from './client-packet-type.js';
8
-
9
-
10
- export class ClientUDPSocketAddMembership implements flatbuffers.IUnpackableObject<ClientUDPSocketAddMembershipT> {
11
- bb: flatbuffers.ByteBuffer|null = null;
12
- bb_pos = 0;
13
- __init(i:number, bb:flatbuffers.ByteBuffer):ClientUDPSocketAddMembership {
14
- this.bb_pos = i;
15
- this.bb = bb;
16
- return this;
17
- }
18
-
19
- static getRootAsClientUDPSocketAddMembership(bb:flatbuffers.ByteBuffer, obj?:ClientUDPSocketAddMembership):ClientUDPSocketAddMembership {
20
- return (obj || new ClientUDPSocketAddMembership()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
21
- }
22
-
23
- static getSizePrefixedRootAsClientUDPSocketAddMembership(bb:flatbuffers.ByteBuffer, obj?:ClientUDPSocketAddMembership):ClientUDPSocketAddMembership {
24
- bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);
25
- return (obj || new ClientUDPSocketAddMembership()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
26
- }
27
-
28
- type():ClientPacketType {
29
- const offset = this.bb!.__offset(this.bb_pos, 4);
30
- return offset ? this.bb!.readInt8(this.bb_pos + offset) : ClientPacketType.TCPSocket;
31
- }
32
-
33
- multicastAddress():string|null
34
- multicastAddress(optionalEncoding:flatbuffers.Encoding):string|Uint8Array|null
35
- multicastAddress(optionalEncoding?:any):string|Uint8Array|null {
36
- const offset = this.bb!.__offset(this.bb_pos, 6);
37
- return offset ? this.bb!.__string(this.bb_pos + offset, optionalEncoding) : null;
38
- }
39
-
40
- multicastInterface():string|null
41
- multicastInterface(optionalEncoding:flatbuffers.Encoding):string|Uint8Array|null
42
- multicastInterface(optionalEncoding?:any):string|Uint8Array|null {
43
- const offset = this.bb!.__offset(this.bb_pos, 8);
44
- return offset ? this.bb!.__string(this.bb_pos + offset, optionalEncoding) : null;
45
- }
46
-
47
- static startClientUDPSocketAddMembership(builder:flatbuffers.Builder) {
48
- builder.startObject(3);
49
- }
50
-
51
- static addType(builder:flatbuffers.Builder, type:ClientPacketType) {
52
- builder.addFieldInt8(0, type, ClientPacketType.TCPSocket);
53
- }
54
-
55
- static addMulticastAddress(builder:flatbuffers.Builder, multicastAddressOffset:flatbuffers.Offset) {
56
- builder.addFieldOffset(1, multicastAddressOffset, 0);
57
- }
58
-
59
- static addMulticastInterface(builder:flatbuffers.Builder, multicastInterfaceOffset:flatbuffers.Offset) {
60
- builder.addFieldOffset(2, multicastInterfaceOffset, 0);
61
- }
62
-
63
- static endClientUDPSocketAddMembership(builder:flatbuffers.Builder):flatbuffers.Offset {
64
- const offset = builder.endObject();
65
- return offset;
66
- }
67
-
68
- static createClientUDPSocketAddMembership(builder:flatbuffers.Builder, type:ClientPacketType, multicastAddressOffset:flatbuffers.Offset, multicastInterfaceOffset:flatbuffers.Offset):flatbuffers.Offset {
69
- ClientUDPSocketAddMembership.startClientUDPSocketAddMembership(builder);
70
- ClientUDPSocketAddMembership.addType(builder, type);
71
- ClientUDPSocketAddMembership.addMulticastAddress(builder, multicastAddressOffset);
72
- ClientUDPSocketAddMembership.addMulticastInterface(builder, multicastInterfaceOffset);
73
- return ClientUDPSocketAddMembership.endClientUDPSocketAddMembership(builder);
74
- }
75
-
76
- unpack(): ClientUDPSocketAddMembershipT {
77
- return new ClientUDPSocketAddMembershipT(
78
- this.type(),
79
- this.multicastAddress(),
80
- this.multicastInterface()
81
- );
82
- }
83
-
84
-
85
- unpackTo(_o: ClientUDPSocketAddMembershipT): void {
86
- _o.type = this.type();
87
- _o.multicastAddress = this.multicastAddress();
88
- _o.multicastInterface = this.multicastInterface();
89
- }
90
- }
91
-
92
- export class ClientUDPSocketAddMembershipT implements flatbuffers.IGeneratedObject {
93
- constructor(
94
- public type: ClientPacketType = ClientPacketType.TCPSocket,
95
- public multicastAddress: string|Uint8Array|null = null,
96
- public multicastInterface: string|Uint8Array|null = null
97
- ){}
98
-
99
-
100
- pack(builder:flatbuffers.Builder): flatbuffers.Offset {
101
- const multicastAddress = (this.multicastAddress !== null ? builder.createString(this.multicastAddress!) : 0);
102
- const multicastInterface = (this.multicastInterface !== null ? builder.createString(this.multicastInterface!) : 0);
103
-
104
- return ClientUDPSocketAddMembership.createClientUDPSocketAddMembership(builder,
105
- this.type,
106
- multicastAddress,
107
- multicastInterface
108
- );
109
- }
110
- }
@@ -1,127 +0,0 @@
1
- // automatically generated by the FlatBuffers compiler, do not modify
2
-
3
- /* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */
4
-
5
- import * as flatbuffers from 'flatbuffers';
6
-
7
- import { ClientPacketType } from './client-packet-type.js';
8
-
9
-
10
- export class ClientUDPSocketAddSourceSpecificMembership implements flatbuffers.IUnpackableObject<ClientUDPSocketAddSourceSpecificMembershipT> {
11
- bb: flatbuffers.ByteBuffer|null = null;
12
- bb_pos = 0;
13
- __init(i:number, bb:flatbuffers.ByteBuffer):ClientUDPSocketAddSourceSpecificMembership {
14
- this.bb_pos = i;
15
- this.bb = bb;
16
- return this;
17
- }
18
-
19
- static getRootAsClientUDPSocketAddSourceSpecificMembership(bb:flatbuffers.ByteBuffer, obj?:ClientUDPSocketAddSourceSpecificMembership):ClientUDPSocketAddSourceSpecificMembership {
20
- return (obj || new ClientUDPSocketAddSourceSpecificMembership()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
21
- }
22
-
23
- static getSizePrefixedRootAsClientUDPSocketAddSourceSpecificMembership(bb:flatbuffers.ByteBuffer, obj?:ClientUDPSocketAddSourceSpecificMembership):ClientUDPSocketAddSourceSpecificMembership {
24
- bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);
25
- return (obj || new ClientUDPSocketAddSourceSpecificMembership()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
26
- }
27
-
28
- type():ClientPacketType {
29
- const offset = this.bb!.__offset(this.bb_pos, 4);
30
- return offset ? this.bb!.readInt8(this.bb_pos + offset) : ClientPacketType.TCPSocket;
31
- }
32
-
33
- sourceAddress():string|null
34
- sourceAddress(optionalEncoding:flatbuffers.Encoding):string|Uint8Array|null
35
- sourceAddress(optionalEncoding?:any):string|Uint8Array|null {
36
- const offset = this.bb!.__offset(this.bb_pos, 6);
37
- return offset ? this.bb!.__string(this.bb_pos + offset, optionalEncoding) : null;
38
- }
39
-
40
- groupAddress():string|null
41
- groupAddress(optionalEncoding:flatbuffers.Encoding):string|Uint8Array|null
42
- groupAddress(optionalEncoding?:any):string|Uint8Array|null {
43
- const offset = this.bb!.__offset(this.bb_pos, 8);
44
- return offset ? this.bb!.__string(this.bb_pos + offset, optionalEncoding) : null;
45
- }
46
-
47
- multicastInterface():string|null
48
- multicastInterface(optionalEncoding:flatbuffers.Encoding):string|Uint8Array|null
49
- multicastInterface(optionalEncoding?:any):string|Uint8Array|null {
50
- const offset = this.bb!.__offset(this.bb_pos, 10);
51
- return offset ? this.bb!.__string(this.bb_pos + offset, optionalEncoding) : null;
52
- }
53
-
54
- static startClientUDPSocketAddSourceSpecificMembership(builder:flatbuffers.Builder) {
55
- builder.startObject(4);
56
- }
57
-
58
- static addType(builder:flatbuffers.Builder, type:ClientPacketType) {
59
- builder.addFieldInt8(0, type, ClientPacketType.TCPSocket);
60
- }
61
-
62
- static addSourceAddress(builder:flatbuffers.Builder, sourceAddressOffset:flatbuffers.Offset) {
63
- builder.addFieldOffset(1, sourceAddressOffset, 0);
64
- }
65
-
66
- static addGroupAddress(builder:flatbuffers.Builder, groupAddressOffset:flatbuffers.Offset) {
67
- builder.addFieldOffset(2, groupAddressOffset, 0);
68
- }
69
-
70
- static addMulticastInterface(builder:flatbuffers.Builder, multicastInterfaceOffset:flatbuffers.Offset) {
71
- builder.addFieldOffset(3, multicastInterfaceOffset, 0);
72
- }
73
-
74
- static endClientUDPSocketAddSourceSpecificMembership(builder:flatbuffers.Builder):flatbuffers.Offset {
75
- const offset = builder.endObject();
76
- return offset;
77
- }
78
-
79
- static createClientUDPSocketAddSourceSpecificMembership(builder:flatbuffers.Builder, type:ClientPacketType, sourceAddressOffset:flatbuffers.Offset, groupAddressOffset:flatbuffers.Offset, multicastInterfaceOffset:flatbuffers.Offset):flatbuffers.Offset {
80
- ClientUDPSocketAddSourceSpecificMembership.startClientUDPSocketAddSourceSpecificMembership(builder);
81
- ClientUDPSocketAddSourceSpecificMembership.addType(builder, type);
82
- ClientUDPSocketAddSourceSpecificMembership.addSourceAddress(builder, sourceAddressOffset);
83
- ClientUDPSocketAddSourceSpecificMembership.addGroupAddress(builder, groupAddressOffset);
84
- ClientUDPSocketAddSourceSpecificMembership.addMulticastInterface(builder, multicastInterfaceOffset);
85
- return ClientUDPSocketAddSourceSpecificMembership.endClientUDPSocketAddSourceSpecificMembership(builder);
86
- }
87
-
88
- unpack(): ClientUDPSocketAddSourceSpecificMembershipT {
89
- return new ClientUDPSocketAddSourceSpecificMembershipT(
90
- this.type(),
91
- this.sourceAddress(),
92
- this.groupAddress(),
93
- this.multicastInterface()
94
- );
95
- }
96
-
97
-
98
- unpackTo(_o: ClientUDPSocketAddSourceSpecificMembershipT): void {
99
- _o.type = this.type();
100
- _o.sourceAddress = this.sourceAddress();
101
- _o.groupAddress = this.groupAddress();
102
- _o.multicastInterface = this.multicastInterface();
103
- }
104
- }
105
-
106
- export class ClientUDPSocketAddSourceSpecificMembershipT implements flatbuffers.IGeneratedObject {
107
- constructor(
108
- public type: ClientPacketType = ClientPacketType.TCPSocket,
109
- public sourceAddress: string|Uint8Array|null = null,
110
- public groupAddress: string|Uint8Array|null = null,
111
- public multicastInterface: string|Uint8Array|null = null
112
- ){}
113
-
114
-
115
- pack(builder:flatbuffers.Builder): flatbuffers.Offset {
116
- const sourceAddress = (this.sourceAddress !== null ? builder.createString(this.sourceAddress!) : 0);
117
- const groupAddress = (this.groupAddress !== null ? builder.createString(this.groupAddress!) : 0);
118
- const multicastInterface = (this.multicastInterface !== null ? builder.createString(this.multicastInterface!) : 0);
119
-
120
- return ClientUDPSocketAddSourceSpecificMembership.createClientUDPSocketAddSourceSpecificMembership(builder,
121
- this.type,
122
- sourceAddress,
123
- groupAddress,
124
- multicastInterface
125
- );
126
- }
127
- }
@@ -1,138 +0,0 @@
1
- // automatically generated by the FlatBuffers compiler, do not modify
2
-
3
- /* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */
4
-
5
- import * as flatbuffers from 'flatbuffers';
6
-
7
- import { ClientPacketType } from './client-packet-type.js';
8
-
9
-
10
- export class ClientUDPSocketBind implements flatbuffers.IUnpackableObject<ClientUDPSocketBindT> {
11
- bb: flatbuffers.ByteBuffer|null = null;
12
- bb_pos = 0;
13
- __init(i:number, bb:flatbuffers.ByteBuffer):ClientUDPSocketBind {
14
- this.bb_pos = i;
15
- this.bb = bb;
16
- return this;
17
- }
18
-
19
- static getRootAsClientUDPSocketBind(bb:flatbuffers.ByteBuffer, obj?:ClientUDPSocketBind):ClientUDPSocketBind {
20
- return (obj || new ClientUDPSocketBind()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
21
- }
22
-
23
- static getSizePrefixedRootAsClientUDPSocketBind(bb:flatbuffers.ByteBuffer, obj?:ClientUDPSocketBind):ClientUDPSocketBind {
24
- bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);
25
- return (obj || new ClientUDPSocketBind()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
26
- }
27
-
28
- type():ClientPacketType {
29
- const offset = this.bb!.__offset(this.bb_pos, 4);
30
- return offset ? this.bb!.readInt8(this.bb_pos + offset) : ClientPacketType.TCPSocket;
31
- }
32
-
33
- uuid():string|null
34
- uuid(optionalEncoding:flatbuffers.Encoding):string|Uint8Array|null
35
- uuid(optionalEncoding?:any):string|Uint8Array|null {
36
- const offset = this.bb!.__offset(this.bb_pos, 6);
37
- return offset ? this.bb!.__string(this.bb_pos + offset, optionalEncoding) : null;
38
- }
39
-
40
- port():number {
41
- const offset = this.bb!.__offset(this.bb_pos, 8);
42
- return offset ? this.bb!.readFloat32(this.bb_pos + offset) : 0.0;
43
- }
44
-
45
- address():string|null
46
- address(optionalEncoding:flatbuffers.Encoding):string|Uint8Array|null
47
- address(optionalEncoding?:any):string|Uint8Array|null {
48
- const offset = this.bb!.__offset(this.bb_pos, 10);
49
- return offset ? this.bb!.__string(this.bb_pos + offset, optionalEncoding) : null;
50
- }
51
-
52
- exclusive():boolean {
53
- const offset = this.bb!.__offset(this.bb_pos, 12);
54
- return offset ? !!this.bb!.readInt8(this.bb_pos + offset) : false;
55
- }
56
-
57
- static startClientUDPSocketBind(builder:flatbuffers.Builder) {
58
- builder.startObject(5);
59
- }
60
-
61
- static addType(builder:flatbuffers.Builder, type:ClientPacketType) {
62
- builder.addFieldInt8(0, type, ClientPacketType.TCPSocket);
63
- }
64
-
65
- static addUuid(builder:flatbuffers.Builder, uuidOffset:flatbuffers.Offset) {
66
- builder.addFieldOffset(1, uuidOffset, 0);
67
- }
68
-
69
- static addPort(builder:flatbuffers.Builder, port:number) {
70
- builder.addFieldFloat32(2, port, 0.0);
71
- }
72
-
73
- static addAddress(builder:flatbuffers.Builder, addressOffset:flatbuffers.Offset) {
74
- builder.addFieldOffset(3, addressOffset, 0);
75
- }
76
-
77
- static addExclusive(builder:flatbuffers.Builder, exclusive:boolean) {
78
- builder.addFieldInt8(4, +exclusive, +false);
79
- }
80
-
81
- static endClientUDPSocketBind(builder:flatbuffers.Builder):flatbuffers.Offset {
82
- const offset = builder.endObject();
83
- return offset;
84
- }
85
-
86
- static createClientUDPSocketBind(builder:flatbuffers.Builder, type:ClientPacketType, uuidOffset:flatbuffers.Offset, port:number, addressOffset:flatbuffers.Offset, exclusive:boolean):flatbuffers.Offset {
87
- ClientUDPSocketBind.startClientUDPSocketBind(builder);
88
- ClientUDPSocketBind.addType(builder, type);
89
- ClientUDPSocketBind.addUuid(builder, uuidOffset);
90
- ClientUDPSocketBind.addPort(builder, port);
91
- ClientUDPSocketBind.addAddress(builder, addressOffset);
92
- ClientUDPSocketBind.addExclusive(builder, exclusive);
93
- return ClientUDPSocketBind.endClientUDPSocketBind(builder);
94
- }
95
-
96
- unpack(): ClientUDPSocketBindT {
97
- return new ClientUDPSocketBindT(
98
- this.type(),
99
- this.uuid(),
100
- this.port(),
101
- this.address(),
102
- this.exclusive()
103
- );
104
- }
105
-
106
-
107
- unpackTo(_o: ClientUDPSocketBindT): void {
108
- _o.type = this.type();
109
- _o.uuid = this.uuid();
110
- _o.port = this.port();
111
- _o.address = this.address();
112
- _o.exclusive = this.exclusive();
113
- }
114
- }
115
-
116
- export class ClientUDPSocketBindT implements flatbuffers.IGeneratedObject {
117
- constructor(
118
- public type: ClientPacketType = ClientPacketType.TCPSocket,
119
- public uuid: string|Uint8Array|null = null,
120
- public port: number = 0.0,
121
- public address: string|Uint8Array|null = null,
122
- public exclusive: boolean = false
123
- ){}
124
-
125
-
126
- pack(builder:flatbuffers.Builder): flatbuffers.Offset {
127
- const uuid = (this.uuid !== null ? builder.createString(this.uuid!) : 0);
128
- const address = (this.address !== null ? builder.createString(this.address!) : 0);
129
-
130
- return ClientUDPSocketBind.createClientUDPSocketBind(builder,
131
- this.type,
132
- uuid,
133
- this.port,
134
- address,
135
- this.exclusive
136
- );
137
- }
138
- }