Sockets in v3.5

Hi,

I have been using this piece of code I found on this group (https://groups.google.com/d/msg/personal-kdbplus/6-b8MaAO3fY/8Wq1pUjSbPkJ) with much success on v3.3 but found that it no longer works when I upgrade to v3.5.  Specifically, the conn function call in sopen() below:

K sopen(K h,K p){I a,c;if(-KS!=h->t||-KI!=p->t)R krr("type"); a=addr(*h->s=='\0'?(S)"localhost":h->s);if(-1==a)R orr("address"); c=conn(a,p->i);if(-1==c)R orr("connect");R ki(c);}

Returns the error:

'connect. OS reports: Protocol not available

Does anyone know if it’s still possible to open simple sockets in v3.5, and what changes I may need to do so?

Thanks,

Victor

Is that library calling an internal ‘conn’ function rather than the standard connect()? It looks that way.

I’ve just tried to use that code to open a local connection but failed rather miserably as it’s trying to open an SSL connection.

q).skt.open [`;12345i]

4149077688:error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol:s23_clnt.c:794:

'connect. OS reports: Protocol error

You might want to see if there’s an alternative socket library available to you, or perhaps there is a trick to getting kdb to open a simple socket connection…

conn is not part of the supported c-api.

But you may have some luck using

I conn(I a,I p,S s);

and pass s as 0.


Thank you for the suggestion.  It works perfectly in v3.5 now.