Sockets: Difference between revisions

→‎{{header|Wren}}: Added note that, like several other entries, this no longer works and added code to show the error message.
m (→‎{{header|Wren}}: Minor tidy)
(→‎{{header|Wren}}: Added note that, like several other entries, this no longer works and added code to show the error message.)
Line 1,398:
{{trans|C}}
An embedded program so we can ask the C host to call the relevant library functions for us.
 
Although this worked when originally posted, the connection is now refused. The same applies to the C, Go, Phix, Python and Ruby entries and probably others.
<syntaxhighlight lang="wren">/* Sockets.wren */
 
Line 1,463 ⟶ 1,465:
pm = pm[slen..-1]
}
} else if (stat == -1) {
System.print("Connection refused.")
}
var status = Socket.close(sock)
Line 1,693 ⟶ 1,697:
<pre>
$ sudo nc -l 256 & ./Sockets
[19923] 108186074
Connection refused.
hello socket world
</pre>
 
9,482

edits