tryTcpConnectAndReadBanner
tryTcpConnectAndReadBanner(
port,bannerPrefix,connectOptions?):Promise<boolean>
Defined in: net/try-tcp-connect-n-read-banner.ts:19
Connects to port, reads the first line, and returns whether it starts with bannerPrefix. Returns false on any connection or read error, or on abort.
Note: This function does not support reading multi-line banners. It only reads the first line.
Parameters
Section titled “Parameters”number
The TCP port to connect to.
bannerPrefix
Section titled “bannerPrefix”string
The expected prefix of the banner.
connectOptions?
Section titled “connectOptions?”TcpSocketConnectOptions
Optional parameters including connection options and an abort signal.
Returns
Section titled “Returns”Promise<boolean>
A promise that resolves to true if the banner starts with the specified prefix, false otherwise.