Imports Microsoft.Owin Imports Owin <Assembly: OwinStartup(GetType(ImageHub.Startup))> Namespace ImageHub Public Class Startup Public Sub Configuration(ByVal app As IAppBuilder) app.MapSignalR() End Sub End Class End Namespace
Imports Microsoft.AspNet.SignalR Namespace ImageHub <Hubs.HubName("imageHub")> Public Class ImageHub Inherits Hub Public Sub updateImage(src As String) Clients.All.updateImage(src) End Sub End Class End Namespace
Dim contextHub = GlobalHost.ConnectionManager.GetHubContext("imageHub") contextHub.Clients.All.updateImage("www.imageurl.com")
<script type="text/javascript"> $.connection.hub.start().done(function () { }); var updater = $.connection.imageHub; updater.client.updateImage = function (image_source) { $('#img').attr('src',image_source); }; </script>
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)