I'm new to socket programming. I studied the Mango from http://www.dsource.org/projects/mango . It looks like a good client/server communication if I'm building my client and server as D application. But what if the client is a browser with javascript?
How do I receive a struct from my D server? Any resource or examples that I can find? Most of the things I founds are socket.io or other similar things.
Thanks.
You might be better off using vibe.d for your web server. vibe.d is the currently the most popular D web server library, largely because of its completeness and efficiency.
For communicating between D and JavaScript, you probably want to use asychronous requests from the browser, which are executed from the client browser at any given time, and the server responds to. JSON would be a good format for you to communicate data with, and vibe.d offers some functionality for creating JSON data and HTTP responses with JSON data. jQuery has some functions for making creating asynchronous requests with JavaScript and JSON easy.
So in summary.
Additionally, if you are looking to push updates from your web server to your client application, vibe.d also offers some WebSocket functionality, for socket connections.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.