I am new in programming on Windows 8 platform so I'm stuck. In my project I use SignalR (I downloaded and installed the package correctly) and tried to implement a connection simply, with this code : http://code.msdn.microsoft.com/wpapps/Windows-Phone-8-Chat-1fa5eccf
public Play()
{
InitializeComponent();
_connection = new HubConnection(websiteUrl);
_myHub = _connection.CreateHubProxy("GameManager");
InitializeConnection();
}
public async Task InitializeConnection()
{
try
{
var obj = new
{
header = 0,
data = App.login,
};
var result = JsonConvert.SerializeObject(obj, Formatting.Indented);
await _connection.Start();
await _myHub.Invoke("SendConnection", result);
IsConnected = true;
_myHub.On<string>("recieved", data =>
{
if (OnRecieved != null)
{
OnRecieved(this, new ChatEventArgs { MessageSent = data });
System.Diagnostics.Debug.WriteLine("DATA : " + data);
}
});
if (OnConnected != null)
{
OnConnected(this, new EventArgs());
}
}
catch
{
}
}
websiteUrl is the Url of the website I'm trying to reach.
However, I do not succeed in receiving a response from the server (and I know it returns something if the connection is successful).
Do I need to do something more or differently ? Thanks for your help.