Y
Y
ya_yshel_rabotati_v_teleg2019-02-18 15:38:52
Node.js
ya_yshel_rabotati_v_teleg, 2019-02-18 15:38:52

How to close connect via net.createConnection?

I open a connection via net.createConnection,
how can I force it to close?
var client = net.createConnection({ port: 9801, host:'10.31.200.161' });
client end(); - Does not help

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry Belyaev, 2019-02-18
@ya_yshel_rabotati_v_teleg

the end method only sends a FIN packet, the connection will be closed when the other side also sends a FIN packet.
to break the connection unilaterally (without sending anything to the other side), there is a destroy method
https://nodejs.org/dist/latest-v10.x/docs/api/net....

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question