Nice post Kirill. Wondering if you’ve seen this repo I wrote a few years back:
Thank you very much for the praise! Yes, of course I’ve seen your repository. I’m subscribed to you on github ;-). In return, I can give you a link to my 2017 article where I also made a server on WL. Простой http-сервер на Wolfram Language / Хабр
Thanks for the link …
When you do:
server1 = SocketOpen[8001]
it opens a socket using a very old kernel TCP socket implementation (which probably should be removed at this point. I would suggest to always use “ZMQ” in the second argument, or {“ZMQ”, type} for specific connection type.I don’t know if this makes any difference in speed, but I would expect this to be the more long-term supported syntax for sockets.
I investigated the source code of the embedded library that implements sockets - as far as I understand both ZMQ and TCP type sockets use the same zeromq library. I didn’t try to use ZMQ type sockets in my applications as I needed the server to run on pure TCP as I implemented HTTP and WebSocket protocols. As I wrote above - they worked slowly and unstable and in the end I made my implementation in C. As far as I managed to understand the whole problem was in the zeromq library. By the way, Leonid Shifrin advised me to make my own implementation too, because zeromq has many problems of its own. But the most unpleasant thing is that I have no control over what happens there, because it is a third-party library of a third-party developer.
– you have earned Featured Contributor Badge ![]()
Your exceptional post has been selected for our editorial column Staff Picks http://wolfr.am/StaffPicks and Your Profile is now distinguished by a Featured Contributor Badge and is displayed on the Featured Contributor Board. Thank you!
