Re: Can a C function(server program) be a UDP or TCP server? - Mailing list pgsql-hackers

From D'Arcy J.M. Cain
Subject Re: Can a C function(server program) be a UDP or TCP server?
Date
Msg-id 20071018111325.aa79ccec.darcy@druid.net
Whole thread Raw
In response to Can a C function(server program) be a UDP or TCP server?  ("Billow Gao" <billowgy@gmail.com>)
List pgsql-hackers
On Thu, 18 Oct 2007 10:55:19 -0400
"Billow Gao" <billowgy@gmail.com> wrote:
> Is it possible to write a dynamic loaded C function as an UDP or TCP server?
> 
> What we want to do it is:
> Add a search function which send a UDP package to remote UDP server
> and then listen to an UDP port, waiting for the result.
> Ideally, we don't close the UDP server after the search query end.
> So we can reuse it for next search.
> 
> Is it possible?

Short answer: yes.  Slightly longer answer: If you need to ask this
quetion then you should really talk to someone about network
programming but this is the wrong list.

If you are asking if PostgreSQL already does UDP then the answer is
no.  You need to write a server program that talks UDP in one direction
and TCP to PostgreSQL in the other direction.  Watch out for security
issues.

-- 
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 by date:

Previous
From: "Billow Gao"
Date:
Subject: Can a C function(server program) be a UDP or TCP server?
Next
From: "Billow Gao"
Date:
Subject: Re: Can a C function(server program) be a UDP or TCP server?