You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@apr.apache.org by David Reid <dr...@jetnet.co.uk> on 2000/11/24 01:51:04 UTC

Getting a socket...

When Jeff and I started talking about UDP and then IPv6 he had some ideas
that it's taken me a while to fully get my mind around, so humble apologies
to Jeff for that (my mind has had a lot to deal with recently in it's
defense...)  What follows probably won't bear any relation to his ideas but
I'm sure he'll put me right :))

Anyway, what follows may/may not make sense but it's been bouncing around
for a few days now so I thought I'd share it with you :-)

Should we have a function that can get a socket based on what we're going to
do with it?  This doesn't really matter in a server where you know what
you're doing, but in a client it makes more sense.  I mean, consider the
following pseudo code...

apr_create_me_a_socket(apr_socket_t **, const char *hostname, apr_port_t
port, const char *servname,
                                         apr_protocol_e proto)

apr_create_me_a_socket(&socket, "dns.mynetwork.com", 0, "domain", APR_UDP);
apr_create_me_a_socket(&socket, "remote.host.net", 80, NULL, APR_TCP);
apr_create_me_a_socket(&socket, "remote.host.net", 0, "oracle",
APR_ANYPROTO);

This would perform all the steps to arrive at a fully completed remote_addr
and then actually create a suitable socket.  We could even go one further
and try to connect the socket but we may not want to.  I know these can all
be done, but if I'm a client I shouldn't need to care unless I have specific
needs.  If I just want to create a socket for a particular host/port/service
then I should be able to do so...

Comments?

david



Re: Getting a socket...

Posted by Greg Stein <gs...@lyra.org>.
On Fri, Nov 24, 2000 at 12:51:04AM -0000, David Reid wrote:
>...
> Should we have a function that can get a socket based on what we're going to
> do with it?  This doesn't really matter in a server where you know what

No objections here...

Cheers,
-g

-- 
Greg Stein, http://www.lyra.org/