SocketPlugin extions

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

SocketPlugin extions

Andreas.Raab
Hi Guys -

Attached the extensions for SocketPlugin which are based on David's code
(except I've folded them directly into SocketPlugin). It's basically
just two functions:
a) Being able to mark the socket as "reusable", e.g., setting
SO_REUSADDR/SO_REUSEPORT explicitly (the main reason for putting this
into a separate primitive is because on different platforms subtly
different actions need to be taken)
b) Being able to bind() a socket explicitly to an interface/port.

Cheers,
   - Andreas

SocketPluginDPR.1.cs (2K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: SocketPlugin extions

johnmci
So why do these need to be platform C code, versus invoking the  
proper methods in smalltalk code based on platform type ?

On 26-Mar-06, at 9:45 PM, Andreas Raab wrote:

> Hi Guys -
>
> Attached the extensions for SocketPlugin which are based on David's  
> code (except I've folded them directly into SocketPlugin). It's  
> basically just two functions:
> a) Being able to mark the socket as "reusable", e.g., setting  
> SO_REUSADDR/SO_REUSEPORT explicitly (the main reason for putting  
> this into a separate primitive is because on different platforms  
> subtly different actions need to be taken)
> b) Being able to bind() a socket explicitly to an interface/port.
>
> Cheers,
>   - Andreas
> <SocketPluginDPR.1.cs>

--
========================================================================
===
John M. McIntosh <[hidden email]> 1-800-477-2659
Corporate Smalltalk Consulting Ltd.  http://www.smalltalkconsulting.com
========================================================================
===

Reply | Threaded
Open this post in threaded view
|

Re: SocketPlugin extions

Andreas.Raab
John M McIntosh wrote:
> So why do these need to be platform C code, versus invoking the proper
> methods in smalltalk code based on platform type ?

Because (IIRC) the only reliable way of using SO_REUSEPORT is something
like "#ifdef SO_REUSEPORT" because the versions under which it's
supported (and therefore must be used) are widely varied amongst the
Unix flavours. So just asking is this a "unix" platform isn't enough;
neither is "is this Linux" etc.

Cheers,
    - Andreas

>
> On 26-Mar-06, at 9:45 PM, Andreas Raab wrote:
>
>> Hi Guys -
>>
>> Attached the extensions for SocketPlugin which are based on David's
>> code (except I've folded them directly into SocketPlugin). It's
>> basically just two functions:
>> a) Being able to mark the socket as "reusable", e.g., setting
>> SO_REUSADDR/SO_REUSEPORT explicitly (the main reason for putting this
>> into a separate primitive is because on different platforms subtly
>> different actions need to be taken)
>> b) Being able to bind() a socket explicitly to an interface/port.
>>
>> Cheers,
>>   - Andreas
>> <SocketPluginDPR.1.cs>
>
> --
> ===========================================================================
> John M. McIntosh <[hidden email]> 1-800-477-2659
> Corporate Smalltalk Consulting Ltd.  http://www.smalltalkconsulting.com
> ===========================================================================
>
>
Reply | Threaded
Open this post in threaded view
|

Re: SocketPlugin extions

johnmci
K, well you know the mac vm is using the unix socket support, so  
you'll need to talk to Ian about adding these prims.

On 26-Mar-06, at 10:08 PM, Andreas Raab wrote:

> John M McIntosh wrote:
>> So why do these need to be platform C code, versus invoking the  
>> proper methods in smalltalk code based on platform type ?
>
> Because (IIRC) the only reliable way of using SO_REUSEPORT is  
> something like "#ifdef SO_REUSEPORT" because the versions under  
> which it's supported (and therefore must be used) are widely varied  
> amongst the Unix flavours. So just asking is this a "unix" platform  
> isn't enough; neither is "is this Linux" etc.
>
> Cheers,
>    - Andreas
>
>> On 26-Mar-06, at 9:45 PM, Andreas Raab wrote:
>>> Hi Guys -
>>>
>>> Attached the extensions for SocketPlugin which are based on  
>>> David's code (except I've folded them directly into  
>>> SocketPlugin). It's basically just two functions:
>>> a) Being able to mark the socket as "reusable", e.g., setting  
>>> SO_REUSADDR/SO_REUSEPORT explicitly (the main reason for putting  
>>> this into a separate primitive is because on different platforms  
>>> subtly different actions need to be taken)
>>> b) Being able to bind() a socket explicitly to an interface/port.
>>>
>>> Cheers,
>>>   - Andreas
>>> <SocketPluginDPR.1.cs>
>> --
>> =====================================================================
>> ======
>> John M. McIntosh <[hidden email]> 1-800-477-2659
>> Corporate Smalltalk Consulting Ltd.  http://
>> www.smalltalkconsulting.com
>> =====================================================================
>> ======

--
========================================================================
===
John M. McIntosh <[hidden email]> 1-800-477-2659
Corporate Smalltalk Consulting Ltd.  http://www.smalltalkconsulting.com
========================================================================
===