Echo server: Difference between revisions

Content added Content deleted
Line 1,601: Line 1,601:
table.insert(connections, newClient)
table.insert(connections, newClient)
end</lang>
end</lang>

=={{header|Mathematica}}/{{header|Wolfram Language}}==
This will be able to handle multiple connections and multiple echoes:
<lang Mathematica>server = SocketOpen[12321];
SocketListen[server, Function[{assoc},
With[{client = assoc["SourceSocket"], input = assoc["Data"]},
WriteString[client, ByteArrayToString[input]];
]
]]</lang>


=={{header|Nim}}==
=={{header|Nim}}==