0

I have a requirement where i need to test the time required to send a few bytes. But instead of writing a socket program and jumping into the complexities , i just want to dump the byte 'into the dark' without caring for whether the connection is made or the byte is received. My sole aim is to measure the time taken for the program to send those many bytes. What could be the best way to achieve something like this?

1
  • 1
    Dumping a byte in a file, will take much less time, than over a network. See my post for an easy way to do client server connections. Commented Nov 2, 2012 at 4:24

1 Answer 1

3

UDP should do what you want. You can use DatagramSocket for it in Java.

UDP is a network protocol that doesn't establish a connection before sending data, and doesn't have any (built-in) way to make sure the other side received it.

Sign up to request clarification or add additional context in comments.

2 Comments

so u mean that i do not have to write a client program then. I just want to save myself from the hassle of writing a client program.
@phoenix UDP doesn't care if there's anything on the other side of the connection, so it should work how you want. M.M. makes a good point though -- if you're just throwing the data away, you might as well just write it to a file instead. Or you could just throw the data away, since all you care about is how long it takes to generate it?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.