SlideShare a Scribd company logo
1 of 60
Download to read offline
Comunicandonuestras appscon el mundo exterior 
Roberto Luis Bisbé 
rlbisbe.net 
@rlbisbe
@rlbisbe 
•Ingeniero en Informática @ UAM 
•Desarrollador @ frontiers 
•WP, W8 & Android dev 
•rlbisbe.net
Corría el año2006…
Corría el año2006…
Penetrómetro
Penetrómetro
.NET Compact 
Framework 
.NET 
Framework 
USB 
RemoteAPI
Comunicarnuestras appscon el mundo exterior
Imagen: https://flic.kr/p/aKN6u6 
Examinandola superficie
RaspberryPI 
•ARM 
•Linux 
•USB 
•Ethernet 
•Sensores
RaspberryPI 
•ARM 
•Linux 
•USB 
•Ethernet 
•Sensores
API REST!
Web Sockets
! Web Socket 
•SignalR 
•.NET 
•socket.io 
•node.js 
•Python 
•faye 
•ruby
Qué es WebSocket 
•Bidireccional 
•HTTP 
•Soporte nativo en 8.x
Servidor 
varserver = http.createServer(app) 
server.listen(1430) 
varwss= new WebSocketServer({ server: server }); 
wss.on("connection", function(ws) { 
ws.on("message", function(data) { 
ws.send("response"); 
}) 
ws.on("close", function() { 
//Closed 
}) 
}
Servidor 
varserver = http.createServer(app) 
server.listen(1430) 
varwss= new WebSocketServer({ server: server }); 
wss.on("connection", function(ws) { 
ws.on("message", function(data) { 
ws.send("response"); 
}) 
ws.on("close", function() { 
//Closed 
}) 
}
Servidor 
varserver = http.createServer(app) 
server.listen(1430) 
varwss= new WebSocketServer({ server: server }); 
wss.on("connection", function(ws) { 
ws.on("message", function(data) { 
ws.send("response"); 
}) 
ws.on("close", function() { 
//Closed 
}) 
}
Cliente -Conexión 
varwebSocket= new MessageWebSocket(); 
webSocket.Control.MessageType= SocketMessageType.Utf8; 
webSocket.MessageReceived+= ProcessMessageReceived; 
webSocket.Closed+= Closed; 
awaitwebSocket.ConnectAsync(new Uri("ws://IP:9999"));
Cliente -Conexión 
ver webSocket= new MessageWebSocket(); 
webSocket.Control.MessageType= SocketMessageType.Utf8; 
webSocket.MessageReceived+= ProcessMessageReceived; 
webSocket.Closed+= Closed; 
awaitwebSocket.ConnectAsync(new Uri("ws://IP:9999"));
Cliente -Conexión 
ver webSocket= new MessageWebSocket(); 
webSocket.Control.MessageType= SocketMessageType.Utf8; 
webSocket.MessageReceived+= ProcessMessageReceived; 
webSocket.Closed+= Closed; 
awaitwebSocket.ConnectAsync(new Uri("ws://IP:9999"));
Cliente -Conexión 
ver webSocket= new MessageWebSocket(); 
webSocket.Control.MessageType= SocketMessageType.Utf8; 
webSocket.MessageReceived+= ProcessMessageReceived; 
webSocket.Closed+= Closed; 
awaitwebSocket.ConnectAsync(new Uri("ws://IP:9999"));
Cliente -Envío y recepción 
var_messageWriter= new DataWriter(webSocket.OutputStream); 
_messageWriter.WriteString(message); 
await_messageWriter.StoreAsync(); 
varstream = new 
StreamReader(args.GetDataStream().AsStreamForRead()); 
stringmessage= stream.ReadToEnd();
Cliente -Envío y recepción 
var_messageWriter= new DataWriter(webSocket.OutputStream); 
_messageWriter.WriteString(message); 
await_messageWriter.StoreAsync(); 
varstream = new 
StreamReader(args.GetDataStream().AsStreamForRead()); 
stringmessage= stream.ReadToEnd();
Ejemplo completo 
DEMO 
C# 
Node JS 
WebSocket
WebSocket 
•Bidireccional 
•HTTP 
•Soporte nativo en 8.x
Bajando de nivel 
Imagen: https://flic.kr/p/aKN6u6
StreamSockets 
•Flujo de datos sobre TCP 
•Texto, imágenes, audio, vídeo… 
•Permisos
Servidor -Conexión 
varlistenSocket= new StreamSocketListener(); 
listenSocket.ConnectionReceived+= ConnectionReceived; 
awaitlistenSocket.BindServiceNameAsync("5000");
Servidor -Recepción 
DataReaderreader= new DataReader(connectionSocket.InputStream); 
uintsizeFieldCount= awaitreader.LoadAsync(sizeof(long)); 
if(sizeFieldCount!= sizeof(long)) return; 
uintresultLength= (uint)reader.ReadInt32(); 
uintactualResultLength= awaitreader.LoadAsync(resultLength); 
if(resultLength!= actualResultLength) return; 
varbyteResult= new byte[resultLength]; 
reader.ReadBytes(byteResult);
Servidor -Recepción 
DataReaderreader= new DataReader(connectionSocket.InputStream); 
uintsizeFieldCount= awaitreader.LoadAsync(sizeof(long)); 
if(sizeFieldCount!= sizeof(long)) return; 
uintresultLength= (uint)reader.ReadInt32(); 
uintactualResultLength= awaitreader.LoadAsync(resultLength); 
if(resultLength!= actualResultLength) return; 
varbyteResult= new byte[resultLength]; 
reader.ReadBytes(byteResult);
Servidor -Recepción 
uintsizeFieldCount= awaitreader.LoadAsync(sizeof(long)); 
if(sizeFieldCount!= sizeof(long)) return; 
uintresultLength= (uint)reader.ReadInt32(); 
uintactualResultLength= awaitreader.LoadAsync(resultLength); 
if(resultLength!= actualResultLength) return; 
varbyteResult= new byte[resultLength]; 
reader.ReadBytes(byteResult);
Cliente -Conexión 
varconnectionSocket= new StreamSocket(); 
varserverHost= new HostName(server); 
awaitconnectionSocket.ConnectAsync(serverHost, port);
Cliente -Envío 
varwriter= new DataWriter(connectionSocket.OutputStream); 
writer.WriteInt32(bytes.Length); 
writer.WriteBytes(bytes); 
awaitwriter.StoreAsync(); 
writer.DetachStream();
Cliente -Envío 
varwriter= new DataWriter(connectionSocket.OutputStream); 
writer.WriteInt32(bytes.Length); 
writer.WriteBytes(bytes); 
awaitwriter.StoreAsync(); 
writer.DetachStream();
Cliente -Envío 
varwriter= new DataWriter(connectionSocket.OutputStream); 
writer.WriteInt32(bytes.Length); 
writer.WriteBytes(bytes); 
awaitwriter.StoreAsync(); 
writer.DetachStream();
Ejemplo completo 
DEMO 
WinRTC# 
WinRTC# 
Socket
StreamSockets 
•Flujo de datos sobre TCP 
•Texto, imágenes, audio, vídeo… 
•Requiere permisos
En las profundidades 
Imagen: https://flic.kr/p/48XdaQ
PebbleSmartwatch 
•iOS & Android 
•APIs 
•SDK 
•Bluetooth!
Las cosas no siempre salen como esperamos 
Imagen: https://flic.kr/p/8bDAS1
Volvamos a la RaspberryPI 
•ARM 
•Linux 
•USB 
•Ethernet 
•Sensores
Volvamos a la RaspberryPI 
•ARM 
•Linux 
•USB 
•Ethernet 
•Sensores
Volvamos a la RaspberryPI 
•ARM 
•Linux 
•USB + Bluetooth 
•Ethernet 
•Sensores
Bluetooth IS EVIL 
•P2P 
•Alcance 
•Consumo 
•Servicios 
•Ancho de banda 
•Pairing, Búsqueda, Conexión
Servidor 
server_sock=BluetoothSocket( RFCOMM ) 
server_sock.bind(("",22)) 
server_sock.listen(22) 
client_sock, client_info= server_sock.accept() 
whileTrue: 
data = client_sock.recv(1024) 
client_sock.close() 
server_sock.close()
Servidor 
server_sock=BluetoothSocket( RFCOMM ) 
server_sock.bind(("",22)) 
server_sock.listen(22) 
client_sock, client_info= server_sock.accept() 
whileTrue: 
data = client_sock.recv(1024) 
client_sock.close() 
server_sock.close()
Servidor 
server_sock=BluetoothSocket( RFCOMM ) 
server_sock.bind(("",22)) 
server_sock.listen(22) 
client_sock, client_info= server_sock.accept() 
whileTrue: 
data = client_sock.recv(1024) 
client_sock.close() 
server_sock.close()
Cliente -Búsqueda 
chatServiceInfoCollection= 
awaitDeviceInformation.FindAllAsync( 
RfcommDeviceService.GetDeviceSelector( 
RfcommServiceId.SerialPort));
Cliente –Conexión 
varchatServiceInfo= chatServiceInfoCollection[0]; 
varservice= 
awaitRfcommDeviceService.FromIdAsync(chatServiceInfo.Id); 
awaitchatSocket.ConnectAsync( 
service.ConnectionHostName, 
service.ConnectionServiceName); 
varchatWriter= new DataWriter(chatSocket.OutputStream); 
varchatReader= new DataReader(chatSocket.InputStream);
Cliente –Conexión 
varchatServiceInfo= chatServiceInfoCollection[0]; 
varservice= 
awaitRfcommDeviceService.FromIdAsync(chatServiceInfo.Id); 
awaitchatSocket.ConnectAsync( 
service.ConnectionHostName, 
service.ConnectionServiceName); 
varchatWriter= new DataWriter(chatSocket.OutputStream); 
varchatReader= new DataReader(chatSocket.InputStream);
Cliente –Conexión 
varchatServiceInfo= chatServiceInfoCollection[0]; 
varservice= 
awaitRfcommDeviceService.FromIdAsync(chatServiceInfo.Id); 
awaitchatSocket.ConnectAsync( 
service.ConnectionHostName, 
service.ConnectionServiceName); 
varchatWriter= new DataWriter(chatSocket.OutputStream); 
varchatReader= new DataReader(chatSocket.InputStream);
Cliente –Envío y recepción 
chatWriter.WriteString("open"); 
awaitchatWriter.StoreAsync(); 
byte[] buffer = new byte[10]; 
awaitchatSocket.InputStream.ReadAsync( 
buffer.AsBuffer(), 10, 
InputStreamOptions.Partial); 
stringresult= System.Text.Encoding.UTF8.GetString(buffer, 0, 10);
Cliente –Envío y recepción 
chatWriter.WriteString("open"); 
awaitchatWriter.StoreAsync(); 
byte[] buffer = new byte[10]; 
awaitchatSocket.InputStream.ReadAsync( 
buffer.AsBuffer(), 10, 
InputStreamOptions.Partial); 
stringresult= System.Text.Encoding.UTF8.GetString(buffer, 0, 10);
Ejemplo completo 
DEMO 
C# 
Python 
Bluetooth Serial Port
Bluetooth IS STILL EVIL 
•P2P 
•Alcance 
•Consumo 
•Servicios 
•Ancho de banda 
•Pairing, Búsqueda, Conexión
Podemos comunicarnuestras apps con el mundo exterior
WebSockets, sockets, bluetooth, GPS, infrarrojos, sonido, NFC, sensores
Preguntas? Hay regalitos…
Gracias! Enlaces, código y slidesen rlbisbe.net 
roberto.luis@rlbisbe.net 
@rlbisbe

More Related Content

What's hot

Afrimadoni the power of docker
Afrimadoni   the power of dockerAfrimadoni   the power of docker
Afrimadoni the power of dockerPHP Indonesia
 
WebAssembly WASM Introduction Presentation
WebAssembly WASM Introduction PresentationWebAssembly WASM Introduction Presentation
WebAssembly WASM Introduction PresentationBrad Beiermann
 
Webpack and Web Performance Optimization
Webpack and Web Performance OptimizationWebpack and Web Performance Optimization
Webpack and Web Performance OptimizationChen-Tien Tsai
 
DotNet MVC and webpack + Babel + react
DotNet MVC and webpack + Babel + reactDotNet MVC and webpack + Babel + react
DotNet MVC and webpack + Babel + reactChen-Tien Tsai
 
Javascript Myths and its Evolution
Javascript Myths and its  EvolutionJavascript Myths and its  Evolution
Javascript Myths and its EvolutionDeepu S Nath
 
JS digest, March 2017
JS digest, March 2017JS digest, March 2017
JS digest, March 2017ElifTech
 
Open Source Flash 2010
Open Source Flash 2010Open Source Flash 2010
Open Source Flash 2010Gaurav Saxena
 
Web assembly - Future of the Web
Web assembly - Future of the WebWeb assembly - Future of the Web
Web assembly - Future of the WebCodeValue
 
Managing Node.js Instances with Oracle APEX
Managing Node.js Instances with Oracle APEXManaging Node.js Instances with Oracle APEX
Managing Node.js Instances with Oracle APEXKai Donato
 
Node.js 101 with Rami Sayar
Node.js 101 with Rami SayarNode.js 101 with Rami Sayar
Node.js 101 with Rami SayarFITC
 
An introduction to Node.js
An introduction to Node.jsAn introduction to Node.js
An introduction to Node.jsKasey McCurdy
 
JS digest. May 2017
JS digest. May 2017JS digest. May 2017
JS digest. May 2017ElifTech
 
GeekCampSG - Nodejs , Websockets and Realtime Web
GeekCampSG - Nodejs , Websockets and Realtime WebGeekCampSG - Nodejs , Websockets and Realtime Web
GeekCampSG - Nodejs , Websockets and Realtime WebBhagaban Behera
 
Introduction to node.js aka NodeJS
Introduction to node.js aka NodeJSIntroduction to node.js aka NodeJS
Introduction to node.js aka NodeJSJITENDRA KUMAR PATEL
 
MEAN Stack
MEAN StackMEAN Stack
MEAN StackDotitude
 

What's hot (20)

Afrimadoni the power of docker
Afrimadoni   the power of dockerAfrimadoni   the power of docker
Afrimadoni the power of docker
 
Build App with Nodejs - YWC Workshop
Build App with Nodejs - YWC WorkshopBuild App with Nodejs - YWC Workshop
Build App with Nodejs - YWC Workshop
 
WebAssembly WASM Introduction Presentation
WebAssembly WASM Introduction PresentationWebAssembly WASM Introduction Presentation
WebAssembly WASM Introduction Presentation
 
Webpack and Web Performance Optimization
Webpack and Web Performance OptimizationWebpack and Web Performance Optimization
Webpack and Web Performance Optimization
 
DotNet MVC and webpack + Babel + react
DotNet MVC and webpack + Babel + reactDotNet MVC and webpack + Babel + react
DotNet MVC and webpack + Babel + react
 
Javascript Myths and its Evolution
Javascript Myths and its  EvolutionJavascript Myths and its  Evolution
Javascript Myths and its Evolution
 
Evolution of java script libraries
Evolution of java script librariesEvolution of java script libraries
Evolution of java script libraries
 
JS digest, March 2017
JS digest, March 2017JS digest, March 2017
JS digest, March 2017
 
Open Source Flash 2010
Open Source Flash 2010Open Source Flash 2010
Open Source Flash 2010
 
Web assembly - Future of the Web
Web assembly - Future of the WebWeb assembly - Future of the Web
Web assembly - Future of the Web
 
Managing Node.js Instances with Oracle APEX
Managing Node.js Instances with Oracle APEXManaging Node.js Instances with Oracle APEX
Managing Node.js Instances with Oracle APEX
 
Node.js 101 with Rami Sayar
Node.js 101 with Rami SayarNode.js 101 with Rami Sayar
Node.js 101 with Rami Sayar
 
Node.js for beginner
Node.js for beginnerNode.js for beginner
Node.js for beginner
 
An introduction to Node.js
An introduction to Node.jsAn introduction to Node.js
An introduction to Node.js
 
JS digest. May 2017
JS digest. May 2017JS digest. May 2017
JS digest. May 2017
 
GeekCampSG - Nodejs , Websockets and Realtime Web
GeekCampSG - Nodejs , Websockets and Realtime WebGeekCampSG - Nodejs , Websockets and Realtime Web
GeekCampSG - Nodejs , Websockets and Realtime Web
 
Tech talk: PHP
Tech talk: PHPTech talk: PHP
Tech talk: PHP
 
Introduction to node.js aka NodeJS
Introduction to node.js aka NodeJSIntroduction to node.js aka NodeJS
Introduction to node.js aka NodeJS
 
CloudFoundry@home
CloudFoundry@homeCloudFoundry@home
CloudFoundry@home
 
MEAN Stack
MEAN StackMEAN Stack
MEAN Stack
 

Viewers also liked

Windows 8 Universidad de Valencia
Windows 8 Universidad de ValenciaWindows 8 Universidad de Valencia
Windows 8 Universidad de ValenciaRoberto Luis Bisbé
 
Lecciones aprendidas creando una red social
Lecciones aprendidas creando una red socialLecciones aprendidas creando una red social
Lecciones aprendidas creando una red socialRoberto Luis Bisbé
 
Tres tecnologías Microsoft que no se dan en la carrera
Tres tecnologías Microsoft que no se dan en la carreraTres tecnologías Microsoft que no se dan en la carrera
Tres tecnologías Microsoft que no se dan en la carreraRoberto Luis Bisbé
 
Creando aplicaciones móviles con Windows 8 y Windows Phone 8
Creando aplicaciones móviles con Windows 8 y Windows Phone 8Creando aplicaciones móviles con Windows 8 y Windows Phone 8
Creando aplicaciones móviles con Windows 8 y Windows Phone 8Roberto Luis Bisbé
 
Windows 8 y Metro para desarrolladores .NET
Windows 8 y Metro para desarrolladores .NETWindows 8 y Metro para desarrolladores .NET
Windows 8 y Metro para desarrolladores .NETRoberto Luis Bisbé
 
Una visión multiplataforma con aspnet v next
Una visión multiplataforma con aspnet v nextUna visión multiplataforma con aspnet v next
Una visión multiplataforma con aspnet v nextEduard Tomàs
 
De escritorio a Javascript, nuestra experiencia desde las trincheras
De escritorio a Javascript, nuestra experiencia desde las trincherasDe escritorio a Javascript, nuestra experiencia desde las trincheras
De escritorio a Javascript, nuestra experiencia desde las trincherasRoberto Luis Bisbé
 
Javascript vuela en primera clase con Firefox OS
Javascript vuela en primera clase con Firefox OSJavascript vuela en primera clase con Firefox OS
Javascript vuela en primera clase con Firefox OSRoberto Luis Bisbé
 
DotNetSpain2015: Extendiendo Visual Studio Online a través de su API
DotNetSpain2015: Extendiendo Visual Studio Online a través de su APIDotNetSpain2015: Extendiendo Visual Studio Online a través de su API
DotNetSpain2015: Extendiendo Visual Studio Online a través de su APIRoberto Luis Bisbé
 

Viewers also liked (13)

Windows 8 Universidad de Valencia
Windows 8 Universidad de ValenciaWindows 8 Universidad de Valencia
Windows 8 Universidad de Valencia
 
Lecciones aprendidas creando una red social
Lecciones aprendidas creando una red socialLecciones aprendidas creando una red social
Lecciones aprendidas creando una red social
 
Tres tecnologías Microsoft que no se dan en la carrera
Tres tecnologías Microsoft que no se dan en la carreraTres tecnologías Microsoft que no se dan en la carrera
Tres tecnologías Microsoft que no se dan en la carrera
 
Creando aplicaciones móviles con Windows 8 y Windows Phone 8
Creando aplicaciones móviles con Windows 8 y Windows Phone 8Creando aplicaciones móviles con Windows 8 y Windows Phone 8
Creando aplicaciones móviles con Windows 8 y Windows Phone 8
 
Windows 8 y Metro para desarrolladores .NET
Windows 8 y Metro para desarrolladores .NETWindows 8 y Metro para desarrolladores .NET
Windows 8 y Metro para desarrolladores .NET
 
Windows phonesessions
Windows phonesessionsWindows phonesessions
Windows phonesessions
 
Una visión multiplataforma con aspnet v next
Una visión multiplataforma con aspnet v nextUna visión multiplataforma con aspnet v next
Una visión multiplataforma con aspnet v next
 
De escritorio a Javascript, nuestra experiencia desde las trincheras
De escritorio a Javascript, nuestra experiencia desde las trincherasDe escritorio a Javascript, nuestra experiencia desde las trincheras
De escritorio a Javascript, nuestra experiencia desde las trincheras
 
Javascript vuela en primera clase con Firefox OS
Javascript vuela en primera clase con Firefox OSJavascript vuela en primera clase con Firefox OS
Javascript vuela en primera clase con Firefox OS
 
DotNetSpain2015: Extendiendo Visual Studio Online a través de su API
DotNetSpain2015: Extendiendo Visual Studio Online a través de su APIDotNetSpain2015: Extendiendo Visual Studio Online a través de su API
DotNetSpain2015: Extendiendo Visual Studio Online a través de su API
 
Desarrollo Full Stack UAM.net
Desarrollo Full Stack UAM.netDesarrollo Full Stack UAM.net
Desarrollo Full Stack UAM.net
 
APIs REST
APIs RESTAPIs REST
APIs REST
 
Los lenguajes de la web
Los lenguajes de la webLos lenguajes de la web
Los lenguajes de la web
 

Similar to Comunicando nuestras apps con el mundo exterior

StrongLoop Overview
StrongLoop OverviewStrongLoop Overview
StrongLoop OverviewShubhra Kar
 
IoT Service Bus - High availability with Internet of Things (IoT)/ API Rest/ ...
IoT Service Bus - High availability with Internet of Things (IoT)/ API Rest/ ...IoT Service Bus - High availability with Internet of Things (IoT)/ API Rest/ ...
IoT Service Bus - High availability with Internet of Things (IoT)/ API Rest/ ...Alexandre Brandão Lustosa
 
Matrix.org decentralised communication, Matthew Hodgson, TADSummit
Matrix.org decentralised communication, Matthew Hodgson, TADSummitMatrix.org decentralised communication, Matthew Hodgson, TADSummit
Matrix.org decentralised communication, Matthew Hodgson, TADSummitAlan Quayle
 
Building an ActionScript Game Server with over 15,000 Concurrent Connections
Building an ActionScript Game Server with over 15,000 Concurrent ConnectionsBuilding an ActionScript Game Server with over 15,000 Concurrent Connections
Building an ActionScript Game Server with over 15,000 Concurrent Connections Renaun Erickson
 
Using Java Script and COMPOSE to build cool IoT applications, SenZations 2015
Using Java Script and COMPOSE to build cool IoT applications, SenZations 2015Using Java Script and COMPOSE to build cool IoT applications, SenZations 2015
Using Java Script and COMPOSE to build cool IoT applications, SenZations 2015SenZations Summer School
 
Groovy & Grails eXchange 2012 vert.x presentation
Groovy & Grails eXchange 2012 vert.x presentationGroovy & Grails eXchange 2012 vert.x presentation
Groovy & Grails eXchange 2012 vert.x presentationStuart (Pid) Williams
 
WebRTC Webinar & Q&A - Sumilcast Standards & Implementation
WebRTC Webinar & Q&A - Sumilcast Standards & ImplementationWebRTC Webinar & Q&A - Sumilcast Standards & Implementation
WebRTC Webinar & Q&A - Sumilcast Standards & ImplementationAmir Zmora
 
MUM Middle East 2016 - System Integration Analyst
MUM Middle East 2016 - System Integration AnalystMUM Middle East 2016 - System Integration Analyst
MUM Middle East 2016 - System Integration AnalystFajar Nugroho
 
Intro to node and mongodb 1
Intro to node and mongodb   1Intro to node and mongodb   1
Intro to node and mongodb 1Mohammad Qureshi
 
Apache Directory and the OSGi Service Platform - Enrique Rodriguez, PMC Membe...
Apache Directory and the OSGi Service Platform - Enrique Rodriguez, PMC Membe...Apache Directory and the OSGi Service Platform - Enrique Rodriguez, PMC Membe...
Apache Directory and the OSGi Service Platform - Enrique Rodriguez, PMC Membe...mfrancis
 
Building the Internet of Things with Thingsquare and Contiki - day 1, part 3
Building the Internet of Things with Thingsquare and Contiki - day 1, part 3Building the Internet of Things with Thingsquare and Contiki - day 1, part 3
Building the Internet of Things with Thingsquare and Contiki - day 1, part 3Adam Dunkels
 
Nodejs and WebSockets
Nodejs and WebSocketsNodejs and WebSockets
Nodejs and WebSocketsGonzalo Ayuso
 
Jugando con websockets en nodeJS
Jugando con websockets en nodeJSJugando con websockets en nodeJS
Jugando con websockets en nodeJSIsrael Gutiérrez
 
Vert.X and MSA - DevOps
Vert.X and MSA - DevOpsVert.X and MSA - DevOps
Vert.X and MSA - DevOpsYongHyuk Lee
 

Similar to Comunicando nuestras apps con el mundo exterior (20)

signalr
signalrsignalr
signalr
 
StrongLoop Overview
StrongLoop OverviewStrongLoop Overview
StrongLoop Overview
 
IoT Service Bus - High availability with Internet of Things (IoT)/ API Rest/ ...
IoT Service Bus - High availability with Internet of Things (IoT)/ API Rest/ ...IoT Service Bus - High availability with Internet of Things (IoT)/ API Rest/ ...
IoT Service Bus - High availability with Internet of Things (IoT)/ API Rest/ ...
 
Matrix.org decentralised communication, Matthew Hodgson, TADSummit
Matrix.org decentralised communication, Matthew Hodgson, TADSummitMatrix.org decentralised communication, Matthew Hodgson, TADSummit
Matrix.org decentralised communication, Matthew Hodgson, TADSummit
 
Building an ActionScript Game Server with over 15,000 Concurrent Connections
Building an ActionScript Game Server with over 15,000 Concurrent ConnectionsBuilding an ActionScript Game Server with over 15,000 Concurrent Connections
Building an ActionScript Game Server with over 15,000 Concurrent Connections
 
Using Java Script and COMPOSE to build cool IoT applications, SenZations 2015
Using Java Script and COMPOSE to build cool IoT applications, SenZations 2015Using Java Script and COMPOSE to build cool IoT applications, SenZations 2015
Using Java Script and COMPOSE to build cool IoT applications, SenZations 2015
 
Groovy & Grails eXchange 2012 vert.x presentation
Groovy & Grails eXchange 2012 vert.x presentationGroovy & Grails eXchange 2012 vert.x presentation
Groovy & Grails eXchange 2012 vert.x presentation
 
WebSocket
WebSocketWebSocket
WebSocket
 
WebRTC Webinar & Q&A - Sumilcast Standards & Implementation
WebRTC Webinar & Q&A - Sumilcast Standards & ImplementationWebRTC Webinar & Q&A - Sumilcast Standards & Implementation
WebRTC Webinar & Q&A - Sumilcast Standards & Implementation
 
Real time web apps
Real time web appsReal time web apps
Real time web apps
 
MUM Middle East 2016 - System Integration Analyst
MUM Middle East 2016 - System Integration AnalystMUM Middle East 2016 - System Integration Analyst
MUM Middle East 2016 - System Integration Analyst
 
Intro to node and mongodb 1
Intro to node and mongodb   1Intro to node and mongodb   1
Intro to node and mongodb 1
 
The HTML5 WebSocket API
The HTML5 WebSocket APIThe HTML5 WebSocket API
The HTML5 WebSocket API
 
Apache Directory and the OSGi Service Platform - Enrique Rodriguez, PMC Membe...
Apache Directory and the OSGi Service Platform - Enrique Rodriguez, PMC Membe...Apache Directory and the OSGi Service Platform - Enrique Rodriguez, PMC Membe...
Apache Directory and the OSGi Service Platform - Enrique Rodriguez, PMC Membe...
 
Building the Internet of Things with Thingsquare and Contiki - day 1, part 3
Building the Internet of Things with Thingsquare and Contiki - day 1, part 3Building the Internet of Things with Thingsquare and Contiki - day 1, part 3
Building the Internet of Things with Thingsquare and Contiki - day 1, part 3
 
Nodejs and WebSockets
Nodejs and WebSocketsNodejs and WebSockets
Nodejs and WebSockets
 
Jugando con websockets en nodeJS
Jugando con websockets en nodeJSJugando con websockets en nodeJS
Jugando con websockets en nodeJS
 
111214 node conf
111214 node conf111214 node conf
111214 node conf
 
Apache Libcloud
Apache LibcloudApache Libcloud
Apache Libcloud
 
Vert.X and MSA - DevOps
Vert.X and MSA - DevOpsVert.X and MSA - DevOps
Vert.X and MSA - DevOps
 

More from Roberto Luis Bisbé

More from Roberto Luis Bisbé (8)

Scala desde c# y JavaScript
Scala desde c# y JavaScriptScala desde c# y JavaScript
Scala desde c# y JavaScript
 
Desarrollo de aplicaciones para Windows 8 y Windows Phone
Desarrollo de aplicaciones para Windows 8 y Windows PhoneDesarrollo de aplicaciones para Windows 8 y Windows Phone
Desarrollo de aplicaciones para Windows 8 y Windows Phone
 
Desarrollo Metro con Windows 8 UPM
Desarrollo Metro con Windows 8 UPMDesarrollo Metro con Windows 8 UPM
Desarrollo Metro con Windows 8 UPM
 
Aplicaciones Metro para Windows 8
Aplicaciones Metro para Windows 8Aplicaciones Metro para Windows 8
Aplicaciones Metro para Windows 8
 
Hardcore PHP
Hardcore PHPHardcore PHP
Hardcore PHP
 
El patrón MVC
El patrón MVCEl patrón MVC
El patrón MVC
 
Social Media
Social MediaSocial Media
Social Media
 
Fundamentos de sitios web accesibles
Fundamentos de sitios web accesiblesFundamentos de sitios web accesibles
Fundamentos de sitios web accesibles
 

Recently uploaded

Generative AI for Cybersecurity - EC-Council
Generative AI for Cybersecurity - EC-CouncilGenerative AI for Cybersecurity - EC-Council
Generative AI for Cybersecurity - EC-CouncilVICTOR MAESTRE RAMIREZ
 
Growing Oxen: channel operators and retries
Growing Oxen: channel operators and retriesGrowing Oxen: channel operators and retries
Growing Oxen: channel operators and retriesSoftwareMill
 
JS-Experts - Cybersecurity for Generative AI
JS-Experts - Cybersecurity for Generative AIJS-Experts - Cybersecurity for Generative AI
JS-Experts - Cybersecurity for Generative AIIvo Andreev
 
Introduction-to-Software-Development-Outsourcing.pptx
Introduction-to-Software-Development-Outsourcing.pptxIntroduction-to-Software-Development-Outsourcing.pptx
Introduction-to-Software-Development-Outsourcing.pptxIntelliSource Technologies
 
Enterprise Document Management System - Qualityze Inc
Enterprise Document Management System - Qualityze IncEnterprise Document Management System - Qualityze Inc
Enterprise Document Management System - Qualityze Incrobinwilliams8624
 
Optimizing Business Potential: A Guide to Outsourcing Engineering Services in...
Optimizing Business Potential: A Guide to Outsourcing Engineering Services in...Optimizing Business Potential: A Guide to Outsourcing Engineering Services in...
Optimizing Business Potential: A Guide to Outsourcing Engineering Services in...Jaydeep Chhasatia
 
Streamlining Your Application Builds with Cloud Native Buildpacks
Streamlining Your Application Builds  with Cloud Native BuildpacksStreamlining Your Application Builds  with Cloud Native Buildpacks
Streamlining Your Application Builds with Cloud Native BuildpacksVish Abrams
 
Transforming PMO Success with AI - Discover OnePlan Strategic Portfolio Work ...
Transforming PMO Success with AI - Discover OnePlan Strategic Portfolio Work ...Transforming PMO Success with AI - Discover OnePlan Strategic Portfolio Work ...
Transforming PMO Success with AI - Discover OnePlan Strategic Portfolio Work ...OnePlan Solutions
 
ERP For Electrical and Electronics manufecturing.pptx
ERP For Electrical and Electronics manufecturing.pptxERP For Electrical and Electronics manufecturing.pptx
ERP For Electrical and Electronics manufecturing.pptxAutus Cyber Tech
 
ARM Talk @ Rejekts - Will ARM be the new Mainstream in our Data Centers_.pdf
ARM Talk @ Rejekts - Will ARM be the new Mainstream in our Data Centers_.pdfARM Talk @ Rejekts - Will ARM be the new Mainstream in our Data Centers_.pdf
ARM Talk @ Rejekts - Will ARM be the new Mainstream in our Data Centers_.pdfTobias Schneck
 
OpenChain Webinar: Universal CVSS Calculator
OpenChain Webinar: Universal CVSS CalculatorOpenChain Webinar: Universal CVSS Calculator
OpenChain Webinar: Universal CVSS CalculatorShane Coughlan
 
Deep Learning for Images with PyTorch - Datacamp
Deep Learning for Images with PyTorch - DatacampDeep Learning for Images with PyTorch - Datacamp
Deep Learning for Images with PyTorch - DatacampVICTOR MAESTRE RAMIREZ
 
Big Data Bellevue Meetup | Enhancing Python Data Loading in the Cloud for AI/ML
Big Data Bellevue Meetup | Enhancing Python Data Loading in the Cloud for AI/MLBig Data Bellevue Meetup | Enhancing Python Data Loading in the Cloud for AI/ML
Big Data Bellevue Meetup | Enhancing Python Data Loading in the Cloud for AI/MLAlluxio, Inc.
 
Why Choose Brain Inventory For Ecommerce Development.pdf
Why Choose Brain Inventory For Ecommerce Development.pdfWhy Choose Brain Inventory For Ecommerce Development.pdf
Why Choose Brain Inventory For Ecommerce Development.pdfBrain Inventory
 
Top Software Development Trends in 2024
Top Software Development Trends in  2024Top Software Development Trends in  2024
Top Software Development Trends in 2024Mind IT Systems
 
AI Embracing Every Shade of Human Beauty
AI Embracing Every Shade of Human BeautyAI Embracing Every Shade of Human Beauty
AI Embracing Every Shade of Human BeautyRaymond Okyere-Forson
 
Kawika Technologies pvt ltd Software Development Company in Trivandrum
Kawika Technologies pvt ltd Software Development Company in TrivandrumKawika Technologies pvt ltd Software Development Company in Trivandrum
Kawika Technologies pvt ltd Software Development Company in TrivandrumKawika Technologies
 
Webinar_050417_LeClair12345666777889.ppt
Webinar_050417_LeClair12345666777889.pptWebinar_050417_LeClair12345666777889.ppt
Webinar_050417_LeClair12345666777889.pptkinjal48
 
Your Vision, Our Expertise: TECUNIQUE's Tailored Software Teams
Your Vision, Our Expertise: TECUNIQUE's Tailored Software TeamsYour Vision, Our Expertise: TECUNIQUE's Tailored Software Teams
Your Vision, Our Expertise: TECUNIQUE's Tailored Software TeamsJaydeep Chhasatia
 

Recently uploaded (20)

Generative AI for Cybersecurity - EC-Council
Generative AI for Cybersecurity - EC-CouncilGenerative AI for Cybersecurity - EC-Council
Generative AI for Cybersecurity - EC-Council
 
Salesforce AI Associate Certification.pptx
Salesforce AI Associate Certification.pptxSalesforce AI Associate Certification.pptx
Salesforce AI Associate Certification.pptx
 
Growing Oxen: channel operators and retries
Growing Oxen: channel operators and retriesGrowing Oxen: channel operators and retries
Growing Oxen: channel operators and retries
 
JS-Experts - Cybersecurity for Generative AI
JS-Experts - Cybersecurity for Generative AIJS-Experts - Cybersecurity for Generative AI
JS-Experts - Cybersecurity for Generative AI
 
Introduction-to-Software-Development-Outsourcing.pptx
Introduction-to-Software-Development-Outsourcing.pptxIntroduction-to-Software-Development-Outsourcing.pptx
Introduction-to-Software-Development-Outsourcing.pptx
 
Enterprise Document Management System - Qualityze Inc
Enterprise Document Management System - Qualityze IncEnterprise Document Management System - Qualityze Inc
Enterprise Document Management System - Qualityze Inc
 
Optimizing Business Potential: A Guide to Outsourcing Engineering Services in...
Optimizing Business Potential: A Guide to Outsourcing Engineering Services in...Optimizing Business Potential: A Guide to Outsourcing Engineering Services in...
Optimizing Business Potential: A Guide to Outsourcing Engineering Services in...
 
Streamlining Your Application Builds with Cloud Native Buildpacks
Streamlining Your Application Builds  with Cloud Native BuildpacksStreamlining Your Application Builds  with Cloud Native Buildpacks
Streamlining Your Application Builds with Cloud Native Buildpacks
 
Transforming PMO Success with AI - Discover OnePlan Strategic Portfolio Work ...
Transforming PMO Success with AI - Discover OnePlan Strategic Portfolio Work ...Transforming PMO Success with AI - Discover OnePlan Strategic Portfolio Work ...
Transforming PMO Success with AI - Discover OnePlan Strategic Portfolio Work ...
 
ERP For Electrical and Electronics manufecturing.pptx
ERP For Electrical and Electronics manufecturing.pptxERP For Electrical and Electronics manufecturing.pptx
ERP For Electrical and Electronics manufecturing.pptx
 
ARM Talk @ Rejekts - Will ARM be the new Mainstream in our Data Centers_.pdf
ARM Talk @ Rejekts - Will ARM be the new Mainstream in our Data Centers_.pdfARM Talk @ Rejekts - Will ARM be the new Mainstream in our Data Centers_.pdf
ARM Talk @ Rejekts - Will ARM be the new Mainstream in our Data Centers_.pdf
 
OpenChain Webinar: Universal CVSS Calculator
OpenChain Webinar: Universal CVSS CalculatorOpenChain Webinar: Universal CVSS Calculator
OpenChain Webinar: Universal CVSS Calculator
 
Deep Learning for Images with PyTorch - Datacamp
Deep Learning for Images with PyTorch - DatacampDeep Learning for Images with PyTorch - Datacamp
Deep Learning for Images with PyTorch - Datacamp
 
Big Data Bellevue Meetup | Enhancing Python Data Loading in the Cloud for AI/ML
Big Data Bellevue Meetup | Enhancing Python Data Loading in the Cloud for AI/MLBig Data Bellevue Meetup | Enhancing Python Data Loading in the Cloud for AI/ML
Big Data Bellevue Meetup | Enhancing Python Data Loading in the Cloud for AI/ML
 
Why Choose Brain Inventory For Ecommerce Development.pdf
Why Choose Brain Inventory For Ecommerce Development.pdfWhy Choose Brain Inventory For Ecommerce Development.pdf
Why Choose Brain Inventory For Ecommerce Development.pdf
 
Top Software Development Trends in 2024
Top Software Development Trends in  2024Top Software Development Trends in  2024
Top Software Development Trends in 2024
 
AI Embracing Every Shade of Human Beauty
AI Embracing Every Shade of Human BeautyAI Embracing Every Shade of Human Beauty
AI Embracing Every Shade of Human Beauty
 
Kawika Technologies pvt ltd Software Development Company in Trivandrum
Kawika Technologies pvt ltd Software Development Company in TrivandrumKawika Technologies pvt ltd Software Development Company in Trivandrum
Kawika Technologies pvt ltd Software Development Company in Trivandrum
 
Webinar_050417_LeClair12345666777889.ppt
Webinar_050417_LeClair12345666777889.pptWebinar_050417_LeClair12345666777889.ppt
Webinar_050417_LeClair12345666777889.ppt
 
Your Vision, Our Expertise: TECUNIQUE's Tailored Software Teams
Your Vision, Our Expertise: TECUNIQUE's Tailored Software TeamsYour Vision, Our Expertise: TECUNIQUE's Tailored Software Teams
Your Vision, Our Expertise: TECUNIQUE's Tailored Software Teams
 

Comunicando nuestras apps con el mundo exterior

  • 1. Comunicandonuestras appscon el mundo exterior Roberto Luis Bisbé rlbisbe.net @rlbisbe
  • 2. @rlbisbe •Ingeniero en Informática @ UAM •Desarrollador @ frontiers •WP, W8 & Android dev •rlbisbe.net
  • 7. .NET Compact Framework .NET Framework USB RemoteAPI
  • 10. RaspberryPI •ARM •Linux •USB •Ethernet •Sensores
  • 11. RaspberryPI •ARM •Linux •USB •Ethernet •Sensores
  • 14. ! Web Socket •SignalR •.NET •socket.io •node.js •Python •faye •ruby
  • 15. Qué es WebSocket •Bidireccional •HTTP •Soporte nativo en 8.x
  • 16. Servidor varserver = http.createServer(app) server.listen(1430) varwss= new WebSocketServer({ server: server }); wss.on("connection", function(ws) { ws.on("message", function(data) { ws.send("response"); }) ws.on("close", function() { //Closed }) }
  • 17. Servidor varserver = http.createServer(app) server.listen(1430) varwss= new WebSocketServer({ server: server }); wss.on("connection", function(ws) { ws.on("message", function(data) { ws.send("response"); }) ws.on("close", function() { //Closed }) }
  • 18. Servidor varserver = http.createServer(app) server.listen(1430) varwss= new WebSocketServer({ server: server }); wss.on("connection", function(ws) { ws.on("message", function(data) { ws.send("response"); }) ws.on("close", function() { //Closed }) }
  • 19. Cliente -Conexión varwebSocket= new MessageWebSocket(); webSocket.Control.MessageType= SocketMessageType.Utf8; webSocket.MessageReceived+= ProcessMessageReceived; webSocket.Closed+= Closed; awaitwebSocket.ConnectAsync(new Uri("ws://IP:9999"));
  • 20. Cliente -Conexión ver webSocket= new MessageWebSocket(); webSocket.Control.MessageType= SocketMessageType.Utf8; webSocket.MessageReceived+= ProcessMessageReceived; webSocket.Closed+= Closed; awaitwebSocket.ConnectAsync(new Uri("ws://IP:9999"));
  • 21. Cliente -Conexión ver webSocket= new MessageWebSocket(); webSocket.Control.MessageType= SocketMessageType.Utf8; webSocket.MessageReceived+= ProcessMessageReceived; webSocket.Closed+= Closed; awaitwebSocket.ConnectAsync(new Uri("ws://IP:9999"));
  • 22. Cliente -Conexión ver webSocket= new MessageWebSocket(); webSocket.Control.MessageType= SocketMessageType.Utf8; webSocket.MessageReceived+= ProcessMessageReceived; webSocket.Closed+= Closed; awaitwebSocket.ConnectAsync(new Uri("ws://IP:9999"));
  • 23. Cliente -Envío y recepción var_messageWriter= new DataWriter(webSocket.OutputStream); _messageWriter.WriteString(message); await_messageWriter.StoreAsync(); varstream = new StreamReader(args.GetDataStream().AsStreamForRead()); stringmessage= stream.ReadToEnd();
  • 24. Cliente -Envío y recepción var_messageWriter= new DataWriter(webSocket.OutputStream); _messageWriter.WriteString(message); await_messageWriter.StoreAsync(); varstream = new StreamReader(args.GetDataStream().AsStreamForRead()); stringmessage= stream.ReadToEnd();
  • 25. Ejemplo completo DEMO C# Node JS WebSocket
  • 26. WebSocket •Bidireccional •HTTP •Soporte nativo en 8.x
  • 27. Bajando de nivel Imagen: https://flic.kr/p/aKN6u6
  • 28. StreamSockets •Flujo de datos sobre TCP •Texto, imágenes, audio, vídeo… •Permisos
  • 29. Servidor -Conexión varlistenSocket= new StreamSocketListener(); listenSocket.ConnectionReceived+= ConnectionReceived; awaitlistenSocket.BindServiceNameAsync("5000");
  • 30. Servidor -Recepción DataReaderreader= new DataReader(connectionSocket.InputStream); uintsizeFieldCount= awaitreader.LoadAsync(sizeof(long)); if(sizeFieldCount!= sizeof(long)) return; uintresultLength= (uint)reader.ReadInt32(); uintactualResultLength= awaitreader.LoadAsync(resultLength); if(resultLength!= actualResultLength) return; varbyteResult= new byte[resultLength]; reader.ReadBytes(byteResult);
  • 31. Servidor -Recepción DataReaderreader= new DataReader(connectionSocket.InputStream); uintsizeFieldCount= awaitreader.LoadAsync(sizeof(long)); if(sizeFieldCount!= sizeof(long)) return; uintresultLength= (uint)reader.ReadInt32(); uintactualResultLength= awaitreader.LoadAsync(resultLength); if(resultLength!= actualResultLength) return; varbyteResult= new byte[resultLength]; reader.ReadBytes(byteResult);
  • 32. Servidor -Recepción uintsizeFieldCount= awaitreader.LoadAsync(sizeof(long)); if(sizeFieldCount!= sizeof(long)) return; uintresultLength= (uint)reader.ReadInt32(); uintactualResultLength= awaitreader.LoadAsync(resultLength); if(resultLength!= actualResultLength) return; varbyteResult= new byte[resultLength]; reader.ReadBytes(byteResult);
  • 33. Cliente -Conexión varconnectionSocket= new StreamSocket(); varserverHost= new HostName(server); awaitconnectionSocket.ConnectAsync(serverHost, port);
  • 34. Cliente -Envío varwriter= new DataWriter(connectionSocket.OutputStream); writer.WriteInt32(bytes.Length); writer.WriteBytes(bytes); awaitwriter.StoreAsync(); writer.DetachStream();
  • 35. Cliente -Envío varwriter= new DataWriter(connectionSocket.OutputStream); writer.WriteInt32(bytes.Length); writer.WriteBytes(bytes); awaitwriter.StoreAsync(); writer.DetachStream();
  • 36. Cliente -Envío varwriter= new DataWriter(connectionSocket.OutputStream); writer.WriteInt32(bytes.Length); writer.WriteBytes(bytes); awaitwriter.StoreAsync(); writer.DetachStream();
  • 37. Ejemplo completo DEMO WinRTC# WinRTC# Socket
  • 38. StreamSockets •Flujo de datos sobre TCP •Texto, imágenes, audio, vídeo… •Requiere permisos
  • 39. En las profundidades Imagen: https://flic.kr/p/48XdaQ
  • 40. PebbleSmartwatch •iOS & Android •APIs •SDK •Bluetooth!
  • 41. Las cosas no siempre salen como esperamos Imagen: https://flic.kr/p/8bDAS1
  • 42. Volvamos a la RaspberryPI •ARM •Linux •USB •Ethernet •Sensores
  • 43. Volvamos a la RaspberryPI •ARM •Linux •USB •Ethernet •Sensores
  • 44. Volvamos a la RaspberryPI •ARM •Linux •USB + Bluetooth •Ethernet •Sensores
  • 45. Bluetooth IS EVIL •P2P •Alcance •Consumo •Servicios •Ancho de banda •Pairing, Búsqueda, Conexión
  • 46. Servidor server_sock=BluetoothSocket( RFCOMM ) server_sock.bind(("",22)) server_sock.listen(22) client_sock, client_info= server_sock.accept() whileTrue: data = client_sock.recv(1024) client_sock.close() server_sock.close()
  • 47. Servidor server_sock=BluetoothSocket( RFCOMM ) server_sock.bind(("",22)) server_sock.listen(22) client_sock, client_info= server_sock.accept() whileTrue: data = client_sock.recv(1024) client_sock.close() server_sock.close()
  • 48. Servidor server_sock=BluetoothSocket( RFCOMM ) server_sock.bind(("",22)) server_sock.listen(22) client_sock, client_info= server_sock.accept() whileTrue: data = client_sock.recv(1024) client_sock.close() server_sock.close()
  • 49. Cliente -Búsqueda chatServiceInfoCollection= awaitDeviceInformation.FindAllAsync( RfcommDeviceService.GetDeviceSelector( RfcommServiceId.SerialPort));
  • 50. Cliente –Conexión varchatServiceInfo= chatServiceInfoCollection[0]; varservice= awaitRfcommDeviceService.FromIdAsync(chatServiceInfo.Id); awaitchatSocket.ConnectAsync( service.ConnectionHostName, service.ConnectionServiceName); varchatWriter= new DataWriter(chatSocket.OutputStream); varchatReader= new DataReader(chatSocket.InputStream);
  • 51. Cliente –Conexión varchatServiceInfo= chatServiceInfoCollection[0]; varservice= awaitRfcommDeviceService.FromIdAsync(chatServiceInfo.Id); awaitchatSocket.ConnectAsync( service.ConnectionHostName, service.ConnectionServiceName); varchatWriter= new DataWriter(chatSocket.OutputStream); varchatReader= new DataReader(chatSocket.InputStream);
  • 52. Cliente –Conexión varchatServiceInfo= chatServiceInfoCollection[0]; varservice= awaitRfcommDeviceService.FromIdAsync(chatServiceInfo.Id); awaitchatSocket.ConnectAsync( service.ConnectionHostName, service.ConnectionServiceName); varchatWriter= new DataWriter(chatSocket.OutputStream); varchatReader= new DataReader(chatSocket.InputStream);
  • 53. Cliente –Envío y recepción chatWriter.WriteString("open"); awaitchatWriter.StoreAsync(); byte[] buffer = new byte[10]; awaitchatSocket.InputStream.ReadAsync( buffer.AsBuffer(), 10, InputStreamOptions.Partial); stringresult= System.Text.Encoding.UTF8.GetString(buffer, 0, 10);
  • 54. Cliente –Envío y recepción chatWriter.WriteString("open"); awaitchatWriter.StoreAsync(); byte[] buffer = new byte[10]; awaitchatSocket.InputStream.ReadAsync( buffer.AsBuffer(), 10, InputStreamOptions.Partial); stringresult= System.Text.Encoding.UTF8.GetString(buffer, 0, 10);
  • 55. Ejemplo completo DEMO C# Python Bluetooth Serial Port
  • 56. Bluetooth IS STILL EVIL •P2P •Alcance •Consumo •Servicios •Ancho de banda •Pairing, Búsqueda, Conexión
  • 57. Podemos comunicarnuestras apps con el mundo exterior
  • 58. WebSockets, sockets, bluetooth, GPS, infrarrojos, sonido, NFC, sensores
  • 60. Gracias! Enlaces, código y slidesen rlbisbe.net roberto.luis@rlbisbe.net @rlbisbe