If a communication mechanism has to be established between a stand-alone Dart VM and browser based application on the same machine, how can this be achieved in DART.
The dart:io library does not work in browser-based applications.
Hence, using SendPort/ReceivePort cannot be used.
I think you could:
use WebSockets on the Browser side and
use a (Server)Socket on the stand-alone dart VM to listen for incoming websockets.
Regards,
Robert
EDIT
A long time ago I wrote a nodejs server side implementation of a websocket-server - maybe this helps you do setup the server side if you decide to use websockets:
https://github.com/roberthartung/kit_websocket
Related
I'm attempting to learn UDP coding as a neophyte.
I've been doing iOS development for years and want to start learning to do some basic network coding using the UDP protocol.
Is there a practice site to play with where I can't do any harm?
Or... is it possible to merely wire up the Apache server that comes with OS X and work with that?
This is intended to be for an iOS environment so would at least have to work via simulation.
Apache is an HTTP server, HTTP being a protocol built on TCP not UDP. You're probably going to be best off trying to write both a client and server that run in the same application and having them talk to each other via UDP.
FWIW, DNS is based on UDP, so talking to a public DNS server might be a good starting point.
I'm planning on writing a control panel for Minecraft in Rails but I don't have much experience with Java at all, Minecraft seems to have some standard remote connection and query tools, but most conventional panels don't seem to use them. For example with McMyAdmin, I have disabled remote connectiona and the query, but it still seems to be able to communicate with the server after restarting it after I've edited the server configs to disable the settings.
What I'm asking is if anyone knows how McMyAdmin communicates with the Minecraft server, it comes with a plugin, but I've deleted that as well and it still seems to be able to communicate with the server, I know McMyAdmin is written in .NET and I believe it uses Mono as it's server, as it's cross platform.
If anybody could shed some light on this I'd be ever so greatful, just trying to get my head around the communication.
McMyAdmin uses the plugin to open a socket that it can interact with(Not sure which features are provided using this plugin). The rest of the features are just from the Process instance that it creates. It also just edits the config files for a few things as well or runs commands using the input stream of the process.
I have an embedded device that runs WinCE with wireless capabilites.
I'm looking for advice on technologies I can successfully use that will allow me to easily create a web service on the WinCE device and be able to serve content to my iOS device.
I'd prefer that the web service running on the WinCE device support REST as opposed to SOAP.
A REST Web Service can really be created with anything that can listen and respond to HTTP requests, so a simple socket listener could effectively fulfill your requirements.
Service over wireless and the fact that the client is iOS is actually irrelevant, as the service simply has to know how to respond to HTTP requests, probably (though not certainly) on port 80. If a PC can consume the service, so can iOS, Linux, Andoid, OD/2 or anything else. That's the whole point of a web service.
I assume, however, that you're after something a bit more feature-rich than just rolling your own socket listener. Windows CE has an optional HTTP server that can serve up basic HTML as well as a subset of classic (i.e. 3.0) ASP and some ISAPI. They all tend to be painful to use and debug, but they are included in your OS license and therefore essentially free.
There is also at least one commercial solution that I'm aware of, and that's the Padarn web server. It uses a subset of the IIS object model, so you can easily create IHttpHandlers for URIs and handle requests with compact framework assemblies. As full disclosure, I'm the creator and purveyor of Padarn, so I'm obviously biased toward it.
Is there any way for a Delphi application to use the distributed cache from Hazelcast?
Hazelcast support memcache protocol. You can use a Delphi memcache client library to access Hazelcast cluster.
It depends - a small Java bridge service, using a simple object serialization (JSON) or a efficient custom serialization, would surely work. It could be implemented as a server with Grizzly, Netty or similar libraries. For a protoype, you could use a simple Java based HTTP server which the Delphi client connects to.
If you are not bound to use Hazelcast, there is a Delphi client library for memcached. See MemCached client with Delphi
I want to use Erlang for some background processing and stuff for a web app. I read about its concurrency handling and stuff and I have started learning it. What I want to do specifically is a persistent connection with the clients using COMET - with the Erlang process co-ordinating the HTTP client connections.
Do I need a Erlang based web server for this?
For the actual implementation, how does the "spawn"-ing work in Erlang. I downloaded the erlang ebook and read about spawning. In the case for my web based script, when two clients connect to the same Erlang script by making an HTTP request - can I automatically "spawn" new threads for each of them, and do message passing?
No, you didn't but it is simplest way. You can combine Erlang with libevent to achieve more http://www.metabrew.com/article/a-million-user-comet-application-with-mochiweb-part-3/
Yes, spawn new client is cheap, if you want cheaper see above.
I would highly recommend using an erlang based webserver to handle the comet connections. The lightweight processes in erlang are half the benefit of using it for this type of thing.
Most of the erlang webserver frameworks will handle the spawning for you. No need to reimplement it yourself. See nitrogen and mochiweb for examples of really dead simple comet implementations.
Did you see the page http://beebole.com/erlang ?
It contains:
how to setup an Erlang environment(with Mochiweb) on Ubuntu
how to install the Nginx web server
a video tutorial to build a small web app using Erlang
You should investigate 'YAWS' (high performance HTTP server) modules: easy to write, full flexibility. YAWS is easily installed: apt-get install yaws (on Ubuntu at least).
Another option would be to use Nitrogen - this allows an easy integration of Erlang code in web pages, including a fully-fledged webserver, and comet.