Example
NetConn
NetConn
void
Close closes the connection.
void
Example
N
): Uint8Array
Recv receives data from the connection with a timeout.
If N is 0, it will read all data sent by the server with 8MB limit.
it tries to read until N bytes or timeout is reached.
Name | Type |
---|---|
N | number |
Uint8Array
Example
N
): string
RecvHex receives data from the connection with a timeout
in hex format.
If N is 0,it will read all data sent by the server with 8MB limit.
Name | Type |
---|---|
N | number |
string
Example
N
): Uint8Array
RecvPartial is similar to Recv but it does not perform full read instead
it creates a buffer of N bytes and returns whatever is returned by the connection
this is usually used when fingerprinting services to get initial bytes from the server.
Name | Type |
---|---|
N | number |
Uint8Array
Example
N
): string
RecvString receives data from the connection with a timeout
output is returned as a string.
If N is 0, it will read all data sent by the server with 8MB limit.
Name | Type |
---|---|
N | number |
string
Example
data
): void
Send sends data to the connection with a timeout.
Name | Type |
---|---|
data | string |
void
Example
data
): void
SendArray sends array data to connection
Name | Type |
---|---|
data | any |
void
Example
data
): void
SendHex sends hex data to connection
Name | Type |
---|---|
data | string |
void
Example
value
): void
SetTimeout sets read/write timeout for the connection (in seconds).
Name | Type |
---|---|
value | number |
void
Example