Re: Can a C function(server program) be a UDP or TCP server?

Поиск
Список
Период
Сортировка
От D'Arcy J.M. Cain
Тема Re: Can a C function(server program) be a UDP or TCP server?
Дата
Msg-id 20071018115323.66cd02c1.darcy@druid.net
обсуждение исходный текст
Ответ на Re: Can a C function(server program) be a UDP or TCP server?  ("Billow Gao" <billowgy@gmail.com>)
Ответы Re: Can a C function(server program) be a UDP or TCP server?  (Gregory Stark <stark@enterprisedb.com>)
Re: Can a C function(server program) be a UDP or TCP server?  ("Billow Gao" <billowgy@gmail.com>)
Список pgsql-hackers
On Thu, 18 Oct 2007 11:24:24 -0400
"Billow Gao" <billowgy@gmail.com> wrote:
> I can write the network program.
> But I am not 100% sure whether I can add the c-language function (
> http://www.postgresql.org/docs/8.2/interactive/xfunc-c.html)
> to PostgreSQL. The function will be dynamic loaded by PostgreSQL.
> I want to know whether there are any limitation on the function I wrote.
> 
> for example:
> If I want to write a function:
> 
> PG_FUNCTION_INFO_V1(c_talktoremoteudp);
> 
> 
> And use it in PostgreSQL like:
> 
> =========================================
> SELECT name, c_talktoremoteudp
> 
> (emp, 1500) AS overpaid
>     FROM emp
>     WHERE name = 'Bill' OR name = 'Sam';
> 
> =========================================
> The function c_talktoremoteudp will:
> 1. send udp data to remote udp server
> 2. monitor an udp port and wait for the reply
> 3. return the data to the select query.

I am confused.  The dynamic function resides in the server.  The query
runs in the server.  Where is the "remoteness" in any of this?  Are you
saying that there is a second server that is not PostgreSQL that uses
UDP that you want to communicate with and merge info into the
PostgreSQL server from?

-- 
D'Arcy J.M. Cain <darcy@druid.net>         |  Democracy is three wolves
http://www.druid.net/darcy/                |  and a sheep voting on
+1 416 425 1212     (DoD#0082)    (eNTP)   |  what's for dinner.


В списке pgsql-hackers по дате отправления:

Предыдущее
От: "Billow Gao"
Дата:
Сообщение: Re: Can a C function(server program) be a UDP or TCP server?
Следующее
От: Decibel!
Дата:
Сообщение: Re: max_prepared_transactions default ... why 5?