Re: [HACKERS] Proposal for async support in libpq - Mailing list pgsql-hackers

From Bruce Momjian
Subject Re: [HACKERS] Proposal for async support in libpq
Date
Msg-id 199804190144.VAA07984@candle.pha.pa.us
Whole thread Raw
In response to Re: [HACKERS] Proposal for async support in libpq  (Peter T Mount <psqlhack@maidast.demon.co.uk>)
List pgsql-hackers
> Just a quick question: If you have an OOB packet sent to the backend, how
> would we handle the case where a row is being sent to the backend, but the
> OOB packet comes in the middle of it?
>
> It may sound like a silly question, but I'm thinking if a client is on the
> end of a slow network connection, then the packet containing the row could
> become fragmented, and the OOB packet could get in the way.
>
> Anyhow, I'm trying to find out how to implement OOB in Java. I know it's
> there, as I've seen it in the past. Just can't find it at the moment.
>

Because it is TCP/IP, the packets are re-assembled, so you can't get the
OOB inside a normal packet.  It is not like UDP.  Second, the OOB data
does not arrive in the normal data stream, but must be read by
specifiying the MSG_OOB flag to the the recv() system.  One issue raised
by Stevens' "Unix Network Programming"(p. 333) is that the OOB
signal(SIGURG) can arrive before the data is ready to be read.

I have the Stevens' book, and it will probably be required to get this
working properly.

--
Bruce Momjian                          |  830 Blythe Avenue
maillist@candle.pha.pa.us              |  Drexel Hill, Pennsylvania 19026
  +  If your life is a hard drive,     |  (610) 353-9879(w)
  +  Christ can be your backup.        |  (610) 853-3000(h)

pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: [HACKERS] Proposal for async support in libpq
Next
From: Bruce Momjian
Date:
Subject: Re: [HACKERS] Proposal for async support in libpq