<br><br><div class="gmail_quote">On Tue, Mar 13, 2012 at 4:43 AM, Sven Van Caekenberghe <span dir="ltr"><<a href="mailto:sven@beta9.be">sven@beta9.be</a>></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>
> Most socket API'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>
><br>
> Anyone tried this ?<br>
><br>
> | socket |<br>
> socket := Socket newTCP.<br>
> socket listenOn: 0.<br>
> [ [<br>
> Transcript crShow: 'Port is ', socket localPort printString.<br>
> (socket waitForAcceptFor: 60)<br>
> ifNotNil: [ :client | | data |<br>
> data := client receiveDataTimeout: 30.<br>
> Transcript crShow: 'Received ', data asString.<br>
> data ifNotNil: [ client sendData: data reverse; close ]<br>
> ].<br>
> ] ensure: [ socket close ] ] fork.<br>
><br>
> I am running the Pharo Cog VM on Mac OS X using Pharo 1.4.<br>
><br>
> Thx,<br>
><br>
> Sven<br>
><br>
<br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br>best,<div>Eliot</div><br>