On Mon, Jan 18, 2010 at 11:46 PM, Magnus Hagander <mag...@hagander.net> wrote: >>> From what I can tell, this indicates that pq_getbyte_if_available() is >>> not working - because it's supposed to never block, right? >> >> Right, it's not supposed to block. >> >>> This could be because the win32 socket emulation layer simply wasn't >>> designed to deal with non-blocking sockets. Specifically, it actually >>> *always* sets the socket to non-blocking mode, and then uses that to >>> properly emulate how sockets work under unix. >> >> I presume the win32 emulation layer can be taught about non-blocking >> sockets? Or maybe pq_getbyte_if_available() can be implemented using >> some other simpler method on Windows. > > It could be taught that, but it would probably be a lot easier to put > platform specific code in pq_getbyte_if_available().
Umm.. in this case, for SSL on win32 case, we also need to create new function like my_sock_read_if_available() that receives data from non-blocking socket, and reassign it to the SSL BIO function. Right? If so, it seems easier for me to tell the win32 layer about non-blocking. Regards, -- Fujii Masao NIPPON TELEGRAPH AND TELEPHONE CORPORATION NTT Open Source Software Center -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers