Professional Documents
Culture Documents
Il futuro a portata di
mano
What is real-time?
A cloud server is very scalable then. In fact, if you need to increase the workload that the
cloud has to do, you only have to increase the power of your cloud, and it can be done
very easily.
What if we can mix cloud computing and real-time?
Using Real-time technology together with the cloud, means aligning the power of a realtime communication with the flexibility and accessibility of the cloud.
It would mean to leave the common vision of the cloud, which is seen as nothing more
than an online hard-disk for storing information. It would mean starting to use this
powerful tool in a more completely way.
And with this line of thought, I want to show you my project: Remote Mobile Manager.
The target of this project is to make it possible for every person to manage an electronic
device from every place in the world, using the Real-time web. Only Windows PCs have
been used.
The features of this application are still many: you can administrate your PC from
everywhere you are, using a very small amount of Internet traffic. It can be used as a
remote controller in the same way as it can be used to check what the PC is doing.
The mobile application is divided into seven pages.
The first one is used to select the PC (or the device) you want to connect to, and then to
establish the connection with it.
Then there is a page that allows you to manage the files and the directories in your PC.
You can copy and move every element from anywhere to anywhere. You can even
rename o delete every file or directory in your PC.
The third page administrates the boot operations of the PC, so from this page you can
shutdown, reboot, suspend or block your device. You can even set a timer or a date in
which the PC will shutdown.
Then there is the screenshot page. From here you can have a screenshot of your PC
desktop on your phone, just for checking what it is doing.
The other two pages allows you to start MP3s or videos remotely, by selecting them from
the menus in the app. After starting a song (or a video), you can pause it, skip to the
next one, and so on.
At the end there is the last page, whose target is to control the slideshow in Power Point
(just moving to the next or the previous slide).
The RMM Web Server works with a cloud hosting, and it has the task to handle every
request that comes from the client devices (both the Smartphone and the Windows PC
are clients).
The RMM PC Side is a tray application installed in the desktop PC, and it has the job to
execute every request coming from the Web Server (only in the case of the screenshot,
the application answers the server with the image to upload).
At the base of this application there are the WebSockets, and now its time to start
talking about this powerful technology.
Web Sockets
Per sfruttare al meglio le capacit dellinnovativo linguaggio di programmazione web
HTML5 il World wide web Consortium (W3C) ha standardizzato di recente una nuova e
potente tecnologia, chiamata WebSocket.
Cos il WebSocket?
Da definizione, il WebSocket la tecnologia che permette di instaurare un canale di
comunicazione full-duplex con ununica connessione TCP.
Detto in parole semplici la tecnologia che permette di comunicare con una risorsa web
alleggerendo pi possibile il carico di traffico inviato o ricevuto e massimizzandone le
prestazioni.
Il WebSocket, nella sua standardizzazione, stato definito come una tecnologia realtime, che differisce in maniera sostanziale da tecnologie come il long-time polling (che
vengono definite near real-time), utilizzate per le attuali applicazioni Web (Web API).
Ci significa che la trasmissione dei dati tramite WebSocket avviene con una velocit
elevatissima, in tempo reale praticamente.
Utilizzare questo tipo di tecnologia, per, complesso, e prevede la conoscenza di
linguaggi informatici non sempre rapidi da apprendere.
Microsoft prende la palla al balzo
Microsoft, nel suo continuo essere in ritardo, si comunque chiesta: Bene, ora
sappiamo che esiste questa tecnologia. La possiamo offrire ai nostri programmatori in
maniera uniforme e semplificata?
La risposta non tarda a farsi sentire:
SignalR.
Che cos SignalR?
SignalR una libreria ideata in principio per i programmatori di web server che utilizzano
ASP.NET MVC (modello di sviluppo di web server basato su Visual Basic e C#, linguaggi di
programmazione proprietari di Microsoft).
La libreria, per quanto proprietaria di Microsoft, per progettata in jQuery, una
estensione del JavaScript (anche questo linguaggio usato per lo sviluppo di applicazioni
web).
Originariamente concepito per essere utilizzato in un gioco online di nome ShootR,
SignalR stato rilasciato come libreria ufficiale di ASP.NET, e ad oggi, probabilmente
lunico mezzo che permette di interfacciarsi al mondo dei WebSocket in maniera
semplice e intuitiva.
La libreria esiste da poco, ma in questo poco tempo stata estesa per funzionare non
pi unicamente sul framework .NET (Microsoft) ma anche sul framework Mono, sul quale
si basano le applicazioni iOS e Android. Dunque la flessibilit di questa libreria ha
raggiunto anche il mondo del mobile.
Possiamo quindi annoverare SignalR tra le pi semplici e potenti tecnologie che il mondo
informatico possa offrire.
Come funziona SignalR?
SignalR sfrutta HTTP attraverso i WebSockets. Chiaramente, per, questo tipo di
comunicazione non supportata da tutti i dispositivi, e quindi Microsoft ha implementato
in esso anche metodi di scambio di informazione pi lenti, ma pi retrocompatibili (come
ad esempio il long polling, per riprenderne uno sopracitato).
SignalR pone alla base di queste tecnologie real-time (o near real-time) due tipi di
connessione:
-
Connessione Persistente
Connessione Hub
English for new technology Kiaran OMalley Pearson 2012 Milano, Italia
Pro ASP.NET SignalR, Real-Time communications in .NET with SignalR 2.0 Keyvan
Nayyeri, Darren White Apress 2014