sv / kdbgo

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

Add new function for creation a connection DialKDBContext. #27

Closed lkramer closed 4 years ago

lkramer commented 4 years ago

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.

sv commented 4 years ago

Could you base your change on v1beta? it changes Dial api, so i would prefer to make changes like this in that branch

lkramer commented 4 years ago

Tracking in https://github.com/sv/kdbgo/pull/28 instead.