Skip to content

Instantly share code, notes, and snippets.

@vgheri
Created November 18, 2012 15:57
Show Gist options
  • Select an option

  • Save vgheri/4105971 to your computer and use it in GitHub Desktop.

Select an option

Save vgheri/4105971 to your computer and use it in GitHub Desktop.
Estabilishing a connection to the server
$(document).ready(function () {
var username = @Html.Raw(Json.Encode(Model));
PongR.createInstance(1200,600,username);
PongR.connect();
});
pongR.PublicPrototype.connect = function () {
$.connection.hub.start()
.done(function () {
pongR.pongRHub.joined(); // pongRHub is the SignalR object holding connection info
});
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment