apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "David Reid" <dr...@jetnet.co.uk>
Subject Getting a socket...
Date Fri, 24 Nov 2000 00:51:04 GMT
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



Mime
View raw message