file/socket descriptor access
Posted in 2000
Topics: Connectivity: ESQL/C, 4GL & Embedded SQL
Hi, I am developing a server that must interact with connections to IDS databases as well as other arbitrary TCP connections. Ideally, I would like to be able to poll()/select() across all file descriptors with which the server interacts (including the Informix ESQL/C connections). Is there anyway to pull this off in the client SDK? My cursory review found out that sqli_connect_open() doesn't return a file descriptor. :( I am also interested to see how others may have addressed this scenario if they did not get access to the file/socket descriptors. Thank you for any pointers. -Scott
"Scott A. Guyer" wrote: > I am developing a server that must interact with connections > to IDS databases as well as other arbitrary TCP connections. > Ideally, I would like to be able to poll()/select() across > all file descriptors with which the server interacts (including > the Informix ESQL/C connections). Is there anyway to pull this > off in the client SDK? Officially, no. Of course, there's nothing to stop you from using the sysconf() and related calls to find out how many file descriptors are available for use, and then you can scan through the possible file descriptors to see which ones are open (probably with fstat()), and then think about whether you want to poll/select on that file descriptor -- you won't want to poll/select on regular files, for example. > My cursory review found out that > sqli_connect_open() doesn't return a file descriptor. :( Whatever gave you the idea that it would? It most likely returns an error code, but in any case, this is an undocumented function, and calling it directly is totally unsupported. You'd have to write an EXE SQL CONNECT statement to be in with a fighting chance of being supported. > I am also interested to see how others may have addressed this > scenario if they did not get access to the file/socket descriptors. > > Thank you for any pointers. File descriptors are integers, not pointers :-) -- Yours, Jonathan Leffler (Jonathan.Leffler@Informix.com) #include <disclaimer.h> Guardian of DBD::Informix v1.00.PC1 -- http://www.perl.com/CPAN "I don't suffer from insanity; I enjoy every minute of it!"