TcpClient
Description
TCP client provides TCP socket input and output operations.
Example
let tcpServer = TcpServer();
let port = 3000;
let portNotSet = true;
while (portNotSet) {
try {
await tcpServer.bind(port++);
portNotSet = false;
} catch {
// https://wiki.c2.com/?PokemonExceptionHandling
}
}
tcpServer.listen().then((tcpClientB) => {
console.write(await tcpClientB.receive());
await tcpClientB.close();
});
let tcpClientA = TcpClient();
await tcpClientA.connect("127.0.0.1", port);
await tcpClientA.send("abcd");
await tcpClientA.close();
Expected output
abcd
Members
Inherited members
==
addProperty
classPrototype
getId
getOwnPropertyNames
hasOwnProperty
readOperator
removeProperty
toArray
toBoolean
toJson
toNumber
toString
Properties
classPrototype