• Post Reply Bookmark Topic Watch Topic
  • New Topic

DatagramSocket.setSoTimeout( )

 
Ethan Knepp
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,
I am using a DatagramSocket to retrieve information from a set top box(black box on your TV that you digital cable comes through). The set top box takes about 20 seconds total to return all its telemetry to me.
My question, does the setSoTimeout() set the total time for the DatagramSocket to wait for the total message, or does it set the total time to wait until it recieves the first packet?
Thanks,
Ethan
 
Laudney Ren
Ranch Hand
Posts: 111
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
setSoTimeout() sets the SO_TIMEOUT of the datagram. It's the maximum time the DatagramSocket will wait for the arriva of the datagram before throwing an InterruptedIOException.
 
Ethan Knepp
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yeah after a little testing of my code I answered my own question, but thanks for the answer.
-Ethan
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!