<br><br><div class="gmail_quote">On Tue, Mar 13, 2012 at 4:43 AM, Sven Van Caekenberghe <span dir="ltr">&lt;<a href="mailto:sven@beta9.be">sven@beta9.be</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Can anyone please help me and show me where I should look if I wanted to see the exact C code implementing the socket primitives (for the Pharo built Cog VMs) ?<br></blockquote><div><br></div><div>In trunk (and in my Cog vm source) they are in the directories</div>
<div><br></div><div><a href="http://squeakvm.org/svn/squeak/trunk/platforms/{Cross,Mac">http://squeakvm.org/svn/squeak/trunk/platforms/{Cross,Mac</a> OS,unix,win32}/plugins/SocketPlugin</div><div><br></div><div>i.e. in all VMs locate the relevant platforms hierarchy and look in platforms/{Cross,Mac OS,unix,win32}/plugins/SocketPlugin.</div>
<div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
On 09 Mar 2012, at 16:44, Sven Van Caekenberghe wrote:<br>
<br>
&gt; Most socket API&#39;s allow for the creation of a server socket on the next available port, often by specifying 0 instead of a port. When the socket is bound, one can retrieve the local port and let the client(s) know. I tried to do that in Pharo today, and these steps seem to work, by accepting an incoming connection gives a primitive failed.<br>

&gt;<br>
&gt; Anyone tried this ?<br>
&gt;<br>
&gt; | socket |<br>
&gt; socket := Socket newTCP.<br>
&gt; socket listenOn: 0.<br>
&gt; [ [<br>
&gt;       Transcript crShow: &#39;Port is &#39;, socket localPort printString.<br>
&gt;       (socket waitForAcceptFor: 60)<br>
&gt;               ifNotNil: [ :client | | data |<br>
&gt;                       data := client receiveDataTimeout: 30.<br>
&gt;                       Transcript crShow: &#39;Received &#39;, data asString.<br>
&gt;                       data ifNotNil: [ client sendData: data reverse; close ]<br>
&gt;                       ].<br>
&gt;       ] ensure: [ socket close ] ] fork.<br>
&gt;<br>
&gt; I am running the Pharo Cog VM on Mac OS X using Pharo 1.4.<br>
&gt;<br>
&gt; Thx,<br>
&gt;<br>
&gt; Sven<br>
&gt;<br>
<br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br>best,<div>Eliot</div><br>