sv / kdbgo

kdb+ client driver for Go
MIT License
44 stars 29 forks source link

Add new function for creation a connection DialContext. #28

Closed lkramer closed 4 years ago

lkramer commented 4 years ago

Replacing https://github.com/sv/kdbgo/pull/27 because I couldn't figure out how to change the target branch.

Recap: I had an issue that when KDB went into debug trap mode it would allow establishing a TCP connection, but would not reply to handshake requests, causing the client to hang.

This new function allows to use a context specific timeout which forces a return even if the actual request hangs.

It will also close the connection, which should cause the handshake to fail so there will be no hanging go routine.

I thought about updating DialKDBTimeout with a similar functionality, but held off in case the existing behaviour was intentional. I can make the change if needed.