question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

close() call does not seem to send data before closing

See original GitHub issue

Hey,

I have the following code:

    const graph =new StatsD({ host: 'example.com', port: 8125})

    const responseTime = Date.now() - this.startTime
    graph.timing('.response_time', responseTime)

    graph.close(function(err) {
      console.error('The close did not work quite right: ', err)
    });

With the close call there, no data is sent out at all. Am I using it correctly? The docs specify all data should be sent before the socket is closed.

Tested with tcpdump -n udp dst port 8125

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:2
  • Comments:11

github_iconTop GitHub Comments

3reactions
bdeittecommented, Jan 1, 2019

Happy New Year- fixed this up in the PR above if folks want to review it or try it out.

1reaction
FreifeldRoyicommented, Nov 29, 2018

@bdeitte Is this solved? I think it is still an issue

Read more comments on GitHub >

github_iconTop Results From Across the Web

C TCP Server doesn't send data before closing - Stack Overflow
So I'm not able to receive the values on clientside while the server is still running.
Read more >
Why Is It Important to Close Files in Python?
In this tutorial, you'll dive into that very question. First, you'll learn about how file handles are a limited resource. Then you'll experiment ......
Read more >
WebSocket.close() - Web APIs - MDN Web Docs
close() method closes the WebSocket connection or connection attempt, if any. If the connection is already CLOSED , this method does nothing.
Read more >
socket — Low-level networking interface — Python 3.11.1 ...
A subclass of OSError , this exception is raised when a timeout occurs on a socket which has had timeouts enabled via a...
Read more >
If you don't use "with", when does Python close files? The ...
One of the first things that Python programmers learn is that you can easily read through the contents of an open file by...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found