.NETãã©ãããã©ãŒã ãšãªãŒãã³ãœãŒã¹ãããžã§ã¯ããæããéçºè ã³ãã¥ããã£ã®ãªã³ã©ã€ã³äŒè°ã§ããDotNetConfäŒè°ãçµäºããŸããã
ãã¹ãŠã®äŒè°ã¬ããŒãã¯ã å ¬åŒãŠã§ããµã€ãã®ãªã³ã¯ãããã§ã«å ¥æå¯èœã§ãã
äŒè°ãã©ãããã©ãŒã
ç§ãã¡ã®ãã©ãããã©ãŒã ãäŒè°ãå®è¡ãããŠãããœãããŠã§ã¢ãšåŒã¶ã®ã¯éåžžã«é¢çœãã§ããããã¯ããŸãã«ãããšã³ã¿ãŒãã©ã€ãºãã§ããå ¬åŒã«èãããŸãã éå»ã«ãå¿ èŠãªè²»çšãæ¯æã£ãã¹ãã³ãµãŒãšã®aspConfããã³mvcConfäŒè°ãéå¬ããŸãã ã ã¹ã¿ãžãªã§ãããã£ã³ãã«9ã®ãã¯ãŒã掻çšããã·ã¢ãã«ãŸãã¯Live MeetingãéããŠãããªãæŸéããŸããã
ããããä»å¹Žã¯ãã§ããã ãã·ã³ãã«ã§ãããå®äŸ¡ã§ãããåæ£ãããäŒè°ãéå¬ããããšèããŸããã ã©ããªã¿ã€ã ãŸãŒã³ããã§ãã¹ããŒã«ãŒãæåŸ ãããã£ãã å®ãã£ãïŒ çŽ10ãã«ã æ£ç¢ºãªè«æ±æžã¯åŸã§èšç®ãããŸãã容éãå¢ãããã€ãã³ããéå¬ããåãåã£ããªãœãŒã¹ãæåŠãããã£ãã ãã§ãã
ãããªæŸéãšç»é¢å ±æ
- ä»å¹Žã¯ãGoogleãã³ã°ã¢ãŠããšãã®ãã³ã°ã¢ãŠããªã³ãšã¢æ©èœã䜿çšããŠããŸãã dotnetconf Googleã¢ã«ãŠã³ãã¯ããã¬ãŒã³ã¿ãŒããã³ã°ã¢ãŠãã«æåŸ ãããããŒããã£ã¹ããéå§ããåã«ããªã³ãšã¢ãæ©èœãããŒã¯ããŸãã 次ã«ããã³ã°ã¢ãŠãããŒã«ããã¯ã¹ã䜿çšããŠãç»åã«ã°ã©ãã£ãã¯ã¹ãšãã¬ãŒã³ã¿ãŒã®ååãåçã«è¿œå ããŸãã ãã¹ãŠã®ã¹ããŒã«ãŒã解å床ã1280x768ã«èšå®ããã©ã€ãã¹ããªãŒã ã480pã«æžããããšãã§ããŸãã
- ãæŸééå§ããã¯ãªãã¯ãããšããã«ãYouTubeãžã®ãªã³ã¯ãçæãããã©ã€ãã¹ããªãŒãã³ã°ãå¯èœã«ãªããŸãããæŸéçµäºããã¯ãªãã¯ãããšãé²ç»ããããããªã¯æ°åã§YouTubeã¢ã«ãŠã³ãã§èŠèŽã§ããããã«ãªããŸã ã ïŒããããŒããã£ã¹ãã§é衚瀺ããã¯ãªãã¯ããŠç©ºäžã«æ¶ããŸããäžã®ã¹ã¯ãªãŒã³ã·ã§ããã§ãå·Šãã«ãªã£ãŠããã®ãããããŸããããŸã 衚瀺ãããŠããŸããããå¿ èŠãªå Žåã«ã®ã¿è¡šç€ºãããŸãããããªã¯ãã«ã¹ã¯ãªãŒã³ã«æ¡å€§ãããŸããããããå¿ èŠã§ãã
- éèŠãªæ³šæïŒ 8æéé£ç¶ã§1ã€ã®ãã³ã°ã¢ãŠãã䜿çšãã代ããã«ãçºè¡šè ããšã«æ°ãããã³ã°ã¢ãŠããéå§ããã³åæ¢ããŸããã ããã¯ãYouTubeããŒãžã§æçš¿ãæ¢ã«å ±æãããŠããããšãæå³ããŸãã YouTubeãããªã¯æåãšæåŸããããªãã³ã°ã§ããããããããªã®åŠçã«åé¡ã¯ãããŸããã
ããŒã¿ããŒã¹
ãµãã©ã€ãºïŒ ããŒã¿ããŒã¹ã¯äœ¿çšããŸããã§ããã ãããã¯å¿ èŠãããŸããã§ããã WebMatrixã§èšè¿°ãããASP.NET Web Pagesã䜿çšããŠ2ããŒãžã®ãµã€ããç«ã¡äžããŸããã ãã®ãµã€ãã¯Windows Azureã¯ã©ãŠãã§å®è¡ãããããŒã¿ã»ããïŒã¹ããŒã«ãŒãã¹ã±ãžã¥ãŒã«ããããªã¹ããªãŒã ã®å Žæãªã©ïŒã¯ã»ãšãã©å€ãããªãããããã®ããŒã¿ãXMLãã¡ã€ã«ã«å ¥ããŸãã ããã¯ç¢ºãã«ããŒã¿ããŒã¹ã§ããã貧ãã人ã ã®ããã®ããŒã¿ããŒã¹ã§ãã äžèŠãªãã®ã«ãéãæãã®ã¯ãªãã§ããïŒ
äŒè°äžã«ãããŒã¿ããŒã¹ããã©ã®ããã«æŽæ°ããŸãããïŒ ããªãã®æèŠãè¿°ã¹ãæºåãããŠãã ããã ããŒã¿ã¯DropBoxã«ãããŸãã ïŒã¯ããSkyDriveãŸãã¯ä»»æã®URLã«é 眮ã§ããŸãããDropBoxã䜿çšããŸããïŒã
Webã¢ããªã±ãŒã·ã§ã³ã¯ãDropBoxãããªã³ã¯ããŒã¿ãååŸããŠãã£ãã·ã¥ããŸãã ãšãŠãããŸããããŸãã
<appSettings> <add key="url.playerUrl" value="https://dl.dropboxusercontent.com/s/fancypantsguid/VideoStreams.xml" /> <add key="url.scheduleUrl" value="https://dl.dropboxusercontent.com/s/fancypantsguid/Schedule.xml" /> <add key="url.speakerUrl" value="https://dl.dropboxusercontent.com/s/fancypantsguid/Speakers.xml" /> <add key="Microsoft.ServiceBus.ConnectionString" value="Endpoint=sb://[your namespace].servicebus.windows.net;SharedSecretIssuer=owner;SharedSecretValue=[your secret]" /> </appSettings>
ã³ãŒãã¯åçŽãªãã®ã§ããå¿ èŠããããŸãã ã¹ã±ãžã¥ãŒã«ã®ã¬ã€ã¢ãŠããèŠããã§ããïŒ ã¯ããããã¯<table>ã§ãã ããã¯ãã¹ã±ãžã¥ãŒã«ã®è¡šã§ãã ãã£ïŒ
@foreach(var session in schedule) { var confTime = session.Time; var pstZone = TimeZoneInfo.FindSystemTimeZoneById("Pacific Standard Time"); var attendeeTime = TimeZoneInfo.ConvertTimeToUtc(confTime, pstZone); <tr> <td> <p>@confTime.ToShortTimeString() (PDT)</p> <p>@attendeeTime.ToShortTimeString() (GMT)</p> </td> <td> <div class="speaker-info"> <h4>@session.Title</h4> <span class="company-name"><a class="speaker-website" href="/speakers.cshtml?speaker=@session.Twitter">@session.Name</a></span> <p>@session.Abstract</p> </div> </td> </tr> }
ã¹ã±ãŒãªã³ã°
Windows Azure Webãµã€ãã®è¶ å°åïŒWindows Azureã®çšèª -ãããTranslã ïŒã®ã€ã³ã¹ã¿ã³ã¹ããå§ãã2ã€ã®å€§ããªã€ã³ã¹ã¿ã³ã¹ã«åãæ¿ããŸããïŒæçµçã«ã2ã€ã®äžèŠæš¡ã®ã€ã³ã¹ã¿ã³ã¹ã«ããŒã«ããã¯ãã倧ããªã€ã³ã¹ã¿ã³ã¹ãéåžžã«åŒ·åã§ããããšãå€æããããïŒã
äŒè°äžã«ã®ã¿ã¹ã±ãŒã«ã¢ãããïŒãããã£ãŠãããå€ãæ¯æããŸããïŒãéå¬åŸããµã€ãã¯å°ããªã³ããŒã«ç§»è¡ããŸããã ãããå¿ èŠãšãããªããšãããéã䜿ãå¿ èŠã¯ãããŸããã
SignalRã䜿çšãããªã¢ã«ã¿ã€ã ã®ãµã€ãæŽæ°
YouTubeã¬ããŒãããããŒããã£ã¹ããããªã³ã¯ãã¹ããŒã«ãŒããšã«å€ãããããäŒè°ã®åå è ãæ°ããURLãååŸããããã«ãã©ãŠã¶ãŒã®ããŒãžãæŽæ°ããå¿ èŠããããšããåé¡ããããŸããã ãã®ã·ããªãªã«ã¯ãèããããå€ãã®è§£æ±ºçããããŸãã ã¡ã¿ã«ããæŽæ°ãã¿ã€ããŒã«ããæŽæ°ãæå®ã§ããŸããããããã®æ±ºå®ã¯ãã¹ãŠãªã³ããã³ãã§å®è¡ãããããã§ã¯ãããŸããã ããã«ãã¹ããŒã«ãŒã®å€æŽäžã«ã¹ã¯ãªãŒã³ã»ãŒããŒã衚瀺ãããã£ãã®ã§ãã ç§ãã¡ã®1人ã次ã®ã¹ããŒã«ãŒãæºåããŠããéãèŠèŽè ã¯ãããªã¹ã¯ãªãŒã³ã»ãŒããŒãåãåããèŠèŽããŠããŸããã
ãã®åé¡ã¯ãäŒè°ã®åå€ã®ååŸ10æããã«çºèŠãããŸããã ãããšã«ãšç§ã¯Skypeã§ãã£ãããã次ã®ããã¯ãããããšã«ããŸããã
誰ããSignalRã¯ã©ã€ã¢ã³ãïŒãªã¢ã«ã¿ã€ã HTML / JSãµãŒããŒ/ã¯ã©ã€ã¢ã³ãã€ã³ã¿ã©ã¯ã·ã§ã³ã©ã€ãã©ãª- ãããTranslã ïŒãæã£ãŠããå Žåã¯ã©ãã§ããããïŒ ãã®åŸã管çã³ã³ãœãŒã«ããããã·ã¥ããããšã«ãããèŠèŽè ã«æ¬¡ã®ãããªãçŽæ¥éä¿¡ã§ããŸãã
ããã説æãããŠãã ããã ãã¥ãŒã¢ãŒïŒããªãïŒã管çè ïŒIïŒããã³ãµãŒããŒïŒãã¹ãïŒãããŸãã ãã¥ãŒã¢ã¯ãSignalRã©ã€ãã©ãªã§æ¬¡ã®JavaScriptã³ãŒããšãšãã«ã¡ã€ã³ããŒãžã䜿çšããŸãã
$(function () { var youtube = $.connection.youTubeHub; $.connection.hub.logging = true; youtube.client.updateYouTube = function (message, password) { $("#youtube").attr("src", "http://www.youtube.com/embed/" + message + "?autoplay=1"); }; $.connection.hub.start(); $.connection.hub.disconnected(function () { setTimeout(function () { $.connection.hub.start(); }, 5000); }); });
èŠèŽè ã¯èãããããããYouTubeãããªã®çãã³ãŒããå«ããµãŒããŒããã®SignalRããã®ã¡ãã»ãŒãžãæåŸ ããŸãã ã¡ãã»ãŒãžãå°çãããšãiFrameã眮ãæããŸãã ãã¹ãŠãã·ã³ãã«ã§ãæ©èœããŸãã
以äžã¯ãæåŸ ããèŠèŽè ã«æ°ããYouTubeãããªã³ãŒããéä¿¡ãã管çã³ã³ãœãŒã«ã®ããŒã¯ã¢ããã§ãïŒASP.NET WebããŒãžãšWebMatrixã®Razorã䜿çšããŠãããããããã¯HTMLãšJSã®æ··åã³ãŒãã§ãïŒã
<div id="container"> <input type="text" id="videoId" name="videoId"> <input type="text" id="password" name="passsword" placeholder="password"> <button id="playerUpdate" name="playerUpdate">Update Player</button> </div> @section SignalR { <script> $(function () { var youtube = $.connection.youTubeHub; $.connection.hub.logging = true; $.connection.hub.start().done(function () { $('#playerUpdate').click(function () { youtube.server.update($('#videoId').val(), $('#password').val()); }); }); $.connection.hub.disconnected(function() { setTimeout(function() { $.connection.hub.start(); }, 5000); }); }); </script> }
çãã³ãŒããšãã¹ã¯ãŒããéä¿¡ããŸãã ããã¯ãã¹ãŠéåžžã«è€éãªã¯ãã§ãããïŒ Windows Azure Service Busã䜿çšããŠã¯ã©ãŠãã§å®è¡ããã匷åãªSignalRããã¯ãšã³ãã¯ã©ã®ãããªãã®ã§ããïŒ ã³ãŒãã倧ããããŠããã°ã«è¡šç€ºã§ããªãã¯ãã§ãããïŒ ãªã©ãã¯ã¹ãåéã
public class YouTubeHub : Microsoft.AspNet.SignalR.Hub { public void update(string message, string password) { if (password.ToLowerInvariant() == "itisasecret") { Clients.All.updateYouTube(message); ConfContext.SetPlayerUrl(message); } } }
ããã¯çŽç²äž»çŸ©è ã®æªå€¢ã§ãããå®çšäž»çŸ©è ã®å€¢ã§ããããŸãã ãããã«ãããäŒè°äžã«ãã®ã³ãŒãã䜿çšããæ©èœããŸããã ã»ãã·ã§ã³éã§ãäºåã«èšé²ãããã¹ãã©ãã·ã¥ãããªãžã®ãªã³ã¯ãéä¿¡ãã次ã®ã¬ããŒãã®åã«åœŒã®ãããªãžã®ãªã³ã¯ãéä¿¡ããŸããã
ããã«ãDropBoxãªã³ã¯ããããªã¹ããªãŒã ã®çŸåšã®ã¢ãã¬ã¹ã§æŽæ°ããŸãããããã«ãããæ°ããããžã¿ãŒã¯ãããªãžã®ãªã³ã¯ã§æ¬¡ã®ããã·ã¥ãåŸ ã€ã®ãééã£ãŠãããããæ°ããããžã¿ãŒã¯ææ°ãããªãžã®æ£ãããªã³ã¯ãåãåããŸããã
ã¹ã±ãŒã«ã¢ããã¯ã©ãã§ããïŒ ãã¡ãŒã å ã«2å°ã®è»ããã£ããããæŽæ°ããããããªãªã³ã¯ãããã·ã¥ããŠã¹ã±ãŒã©ãã«ãªãœãªã¥ãŒã·ã§ã³ã«é©åãããããã«SignalRãå¿ èŠã§ããã ããã«10åããããŸããã
Windows Azure Service Busã䜿çšããSignalRã¹ã±ãŒãªã³ã°
SignalR 1.1ããŒã¿çãšAzure Service Busãããã¯ã䜿çšããŠã¹ã±ãŒãªã³ã°ãããããWindows Azureã¢ã«ãŠã³ãã«Service Busãè¿œå ããŸããã ã¢ããªã±ãŒã·ã§ã³ã®èµ·åã³ãŒããå€æŽãããUseServiceBusïŒïŒã¡ãœããã®åŒã³åºããè¿œå ãããŸããã
string poo = "Endpoint=sb://dotnetconf-live-bus.servicebus.windows.net/;SharedSecretIssuer=owner;SharedSecretValue=g57totalsecrets="; GlobalHost.DependencyResolver.UseServiceBus(poo,"dotnetconf"); RouteTable.Routes.MapHubs();
SignalRã¯ãPublish / Subscribeã¡ã«ããºã ã«Service Bus Topicsãµãã¹ã¯ãªãã·ã§ã³ã䜿çšããŠã2ã€ã®WebãµãŒããŒéã§ããã·ã¥éç¥ãéä¿¡ããããã«ãªããŸããã Web 1ãµãŒããŒããããã·ã¥éä¿¡ãè¡ããšããã®ã¡ãã»ãŒãžã¯ããªã¢ã«ã¿ã€ã SignalRæ¥ç¶ãä»ããŠWeb 1ãµãŒããŒãšWeb 2ïŒãŸãã¯Web NïŒã®äž¡æ¹ã«æ¥ç¶ããŠããå šå¡ã«é ä¿¡ãããŸãã
äŒè°ãçµäºãããšããã«ããã®Service Busãããã¯ãåé€ããŸã ã ç§ã¯æ¬åœã«æ°ãã€ã ã®ã¢ã«ãŠã³ããååŸããããããŸããã ;ïŒä»¥äžã¯ã Windows Azureã§ã®ãã®ãµãŒãã¹ã®äŸ¡æ Œã§ãã
432,000 Service Busã¡ãã»ãŒãžã®ã³ã¹ãã¯432,000 / 10,000 * 0.01ãã«= 44 * 0.01ãã«= 0.44ãã«/æ¥ã§ãã
䜿çšããã¡ãã»ãŒãžã®æ°ã¯ããããŸããããããã»ã©è²»çšãããããªãããšã¯èœã¡çããŠããŸãã
ã³ãã¥ããã£ã«æè¬ããŸãïŒ
- dotnetConfã®ããŽãšãã¶ã€ã³ãäœæããŠããããã¶ã€ããŒJin Yangã«æè¬ããŸãã twitter @jzyã§åœŒã«æè¬ããŸãã HTMLã®ã¬ã€ã¢ãŠããäœæããŠãããDave Wardã«æè¬ããŸãïŒ
- ã³ãŒãã£ã³ã°ã圌ã®çµç¹ããã¬ã€ã³ã¹ããŒãã³ã°ããããŠãããŸã¬åªåã«æè¬ãã Javier Lozanoã«æ¬æãè¡šããŸãã SignalR_codeãæžããŠDotNetConf.net Webãµã€ããæŽæ°ããŠããéãå€ã«æ°æéæ»åšããŠããã圌ã«æè¬ããŸãã
- ããµãŒãã¹ãã¹ã®è¿œå ã«ã¯10åããããããªãããšãããã¬ãŒãºããããDavid Fowlerã«æè¬ããŸãã
- çµç¹ã®ã¹ãã«ãšãã¹ãŠã®äŒè°ã«è²»ããããæéãæäŸããŠãããEric HexterãšJon Gallowayã«æè¬ããŸãã
- ããããäœããããæéãè²»ãããŠã¬ããŒããäœæããã¹ããŒã«ãŒãšãæŸéãšã³ãã¥ãã±ãŒã·ã§ã³ã«é¢é£ããã³ãã¥ããã£ã«æè¬ããããšæããŸãïŒ