<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Jul 10, 2014 at 6:21 PM, David T. Lewis <span dir="ltr">&lt;<a href="mailto:lewis@mail.msen.com" target="_blank">lewis@mail.msen.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><br>
On Thu, Jul 10, 2014 at 03:31:37PM +0200, Bert Freudenberg wrote:<br>
<div class="">&gt;<br>
&gt;<br>
&gt; On 10.07.2014, at 01:54, Eliot Miranda &lt;<a href="mailto:eliot.miranda@gmail.com">eliot.miranda@gmail.com</a>&gt; wrote:<br>
&gt;<br>
&gt; &gt; Hi Max,<br>
&gt; &gt;<br>
&gt; &gt;     I&#39;ve integrated, but there&#39;s a conflict with the Cog sources because there&#39;s already support for RAW sockets in the Qwaq/Terf VM.  That means socket type 2 is already taken.  So I&#39;ve integrated like this:<br>

&gt; &gt;<br>
&gt; &gt; #define TCPSocketType       0<br>
&gt; &gt; #define UDPSocketType       1<br>
&gt; &gt; #ifdef HAVE_SD_DAEMON<br>
&gt; &gt; # define ProvidedTCPSocketType  2<br>
&gt; &gt; # define RAWSocketType      3<br>
&gt; &gt; #else<br>
&gt; &gt; # define RAWSocketType      2<br>
&gt; &gt; #endif<br>
&gt; &gt;<br>
&gt; &gt; But I would prefer to integrate this:<br>
&gt; &gt;<br>
&gt; &gt; #define TCPSocketType       0<br>
&gt; &gt; #define UDPSocketType       1<br>
&gt; &gt; # define RAWSocketType      2<br>
&gt; &gt; #define ProvidedTCPSocketType  3<br>
&gt; &gt;<br>
&gt; &gt; Is it too late for you to change the Smalltalk code so that ProvidedTCPSocketType is 3?<br>
&gt;<br>
</div>&gt; Speaking of which, would it make sense to reserve more socket types?<br>
&gt;<br>
&gt; According to <a href="http://www.freedesktop.org/software/systemd/man/systemd.socket.html" target="_blank">http://www.freedesktop.org/software/systemd/man/systemd.socket.html</a> there are TCP stream (SOCK_STREAM), UDP datagram (SOCK_DGRAM), and sequential packet (SOCK_SEQPACKET) sockets.<br>

&gt;<br>
&gt; - Bert -<br>
&gt;<br>
<br>
There is quite a range of protocol families and socket types, so I&#39;m not sure<br>
it is worth worrying about it too much right now. But I suppose we could adopt<br>
some sort of convention like this:<br>
<br>
<br>
#define TCPSocketType                      0    /* SOCK_STREAM on AF_INET or AF_INET6 */<br>
#define UDPSocketTyp                       1    /* SOCK_DGRAM on AF_INET or AF_INET6 */<br>
#define RAWSocketType                      2    /* SOCK_RAW on AF_INET or AF_INET6 */<br>
#define SeqPacketSocketType                3    /* SOCK_SEQPACKET on AF_INET or AF_INET6 */<br>
#define ReliableDGramSocketType            4    /* SOCK_RDM on AF_INET or AF_INET6 */<br>
<br>
#define ReuseExistingSocket                256<br>
<br>
#define ProvidedTCPSocketType              TCPSocketType + ReuseExistingSocket<br>
#define ProvidedUDPSocketType              UDPSocketType + ReuseExistingSocket<br>
#define ProvidedRAWSocketType              RAWSocketType + ReuseExistingSocket<br>
#define ProvidedSeqPacketSocketType        SeqPacketSocketType + ReuseExistingSocket<br>
#define ProvidedReliableDGramSocketType    ReliableDGramSocketType + ReuseExistingSocket<br></blockquote><div><br></div><div>+1.  But let&#39;s use</div><div> </div><div>#define ReuseExistingSocket                65536<br>
</div><div><br></div><div>ok?</div></div><div><br></div>-- <br>best,<div>Eliot</div>
</div></div>