ruby-dicom icon indicating copy to clipboard operation
ruby-dicom copied to clipboard

Best way to setup a timeout on tcp connection?

Open aamazigh opened this issue 5 years ago • 1 comments

How would you set a timeout on a tcp connection when echoing a server?

The echo method uses TCPSocket, which, as far as I know, doesn't have a timeout.

https://github.com/dicom/ruby-dicom/blob/204ddedf070eaf3819bb1b269bb9f8681c789bb9/lib/dicom/link.rb#L1118

Thank you in advance.

Best regards,

Amazigh

aamazigh avatar Nov 13 '20 13:11 aamazigh

Hi Amazigh

Thanks for raising the question.

Its been a while since this was fresh to me, I'll have to admit.

Please have a look at this to see if it helps you out: https://stackoverflow.com/questions/21014272/how-is-ruby-tcpsocket-timeout-defined

Best regards, Christoffer

dicom avatar Nov 13 '20 14:11 dicom