httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Randall Stewart <rand...@stewart.chicago.il.us>
Subject Re: sockets and such
Date Thu, 10 Oct 2002 15:52:44 GMT
rbb@apache.org wrote:
> On Thu, 10 Oct 2002, Randall Stewart wrote:
> 
> 
>>rbb@apache.org wrote:
>>
>>>On Thu, 10 Oct 2002, Randall Stewart wrote:
>>>
>>>
>>>
>>>>Hi:
>>>>
>>>>I am working on getting apache2 (2.0.43) to be able
>>>>to listen on SCTP sockets as well as TCP.
>>>>
>>>>This involves a small amount of work expanding the
>>>>socket_t to have a protocol field.
>>>
>>>
>>>It should be possible to do this without any core changes, as an initial
>>>implementation.  One of the goals for Apache 2.0, was to allow the socket
>>>to be abstracted out of the server by a module.  If you create your own
>>>module, that implements listening for an SCTP socket, everything should
>>>just work.
>>>
>>>For an example of how to do this, take a look at perchild and how I
>>>inserted the Unix domain socket into the listen_rec list.
>>>
>>
>>Hmm. yes this was one of the things I have looked at.. it is not
>>quite as easy as that though..
>>
>>The problem is in the fact that SCTP and TCP both use SOCK_STREAM :>
>>
>>The TCP-Style interface (which is prefered here since apache expects the
>>listen/accept model) uses the same type. The only difference is
>>the protocol type (third argument to socket()). Now of course
>>all socket calls in apache2 use a ,0); as the last arg.. this is
>>a base problem. I think the right  fix is to add a protocol type
>>and maintain this...
> 
> 
> I'm sorry, I wasn't clear.  Because the server only opens the listening
> socket in one place, the easiest way to do this, is to completely ignore
> Apache.  Just write a module that opens the SCTP socket, and add it to the
> listen_rec list.  From that point on, whenever Apache receives a request
> over an SCTP socket, it will just use it.
> 
> A more long-term approach, is to integrate SCTP into APR, but I don't
> really know how prevalent SCTP is.  If it only works on a small set of
> platforms, then we are less likely to integrate it into APR, because by
> it's very definition, it isn't portable.  There is also the problem that
> the only source I have found for SCTP is under the GPL.
> 

That would be the linux variant... you can find a BSD variant
in the kame stack for Free/Net and Open BSD at

http://www.kame.net

IBM AIX has a stack as well.. proprietary of course
Sun SOLARIS also as a stack.. you used to be able to get the code
                                not sure if that holds now..
HP also has a stack.. not sure I think they bought
    theirs from one of the SCTP vendors..

The only one so far absent from the pool is the MS company :-0 but
that may be changing along the way here..

In my playing here .. I got the configure.in to add a
APR_HAVE_NETINET_SCTP when present.. and then did some
of the underlying support work for the type..




> 
>>I am getting there.. but I still have a problem.. and this may
>>be a config issue.. drats that I did not compile it unchanged first :-0
>>I suppose I will have to go re-download a clean copy..
>>
>>I get everything working.. the TCP and SCTP sockets open up to
>>listen for HTTP requests.. but then somewhere along the line
>>the server does its exit.. I guess after forking its children.. but
>>at that point the SCTP socket closes.. so do the TCP ones as well :-0
>>
>>Thus I suspect a problem in my config...
> 
> 
> This doesn't sound like a config problem.  The Apache parent process
> starts, and then forks to make itself a daemon.  The forked process then
> reads the config, and sets itself and the children up.  That first child
> should never die, and that is where the socket is opened.  It sounds like
> there is some other problem here.

Could be.. I will keep slugging on it and find what I did wrong.. the
SCTP socket is being opened (along with the TCP socket) .. which is
what I want.. but I still have to figure out why it is not staying
open.. I would say it could be a socket api issue .. one of the
reasons I want to test this all.. but I have an earlier version
running with NOTHING but SCTP (by changing the little ,0 to
  ,IPPROTO_SCTP) in the apr...

Hmm.. I will dig some more and see if I can't figure it out..

Note: I do think the right solution is fixing the apr.. if we
       can be sure to carry the protocol type then all sorts
       of neat things can be done in the future to take advantage
       of the sctp streams feature...

R


> 
> Ryan
> 
> _______________________________________________________________________________
> Ryan Bloom                        	rbb@apache.org
> 550 Jean St
> Oakland CA 94610
> -------------------------------------------------------------------------------
> 
> 
> 
> 



-- 
Randall R. Stewart
randall@stewart.chicago.il.us 815-342-5222 (cell phone)


Mime
View raw message