Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Remove implicit Send overload from PersistentConnection.

- Updated samples.
  • Loading branch information...
commit 44ff03aafa5f5e2f3b73a5a19ac5a2437674891b 1 parent c77fcf9
@davidfowl davidfowl authored
View
8 SignalR.Tests/PersistentConnectionFacts.cs
@@ -130,16 +130,16 @@ public class MySendingConnection : PersistentConnection
{
protected override Task OnConnectedAsync(Hosting.IRequest request, string connectionId)
{
- Send("OnConnectedAsync1");
- Send("OnConnectedAsync2");
+ Connection.Send(connectionId, "OnConnectedAsync1");
+ Connection.Send(connectionId, "OnConnectedAsync2");
return base.OnConnectedAsync(request, connectionId);
}
protected override Task OnReceivedAsync(string connectionId, string data)
{
- Send("OnReceivedAsync1");
- Send("OnReceivedAsync2");
+ Connection.Send(connectionId, "OnReceivedAsync1");
+ Connection.Send(connectionId, "OnReceivedAsync2");
return base.OnReceivedAsync(connectionId, data);
}
View
24 SignalR/PersistentConnection.cs
@@ -42,11 +42,6 @@ public virtual void Initialize(IDependencyResolver resolver)
}
/// <summary>
- /// Occurs when data is sent to the calling connection.
- /// </summary>
- public static event Action Sending;
-
- /// <summary>
/// Occurs when a data is received from a connection.
/// </summary>
public static event Action Receiving;
@@ -259,17 +254,6 @@ protected virtual Task OnErrorAsync(Exception error)
return TaskAsyncHelper.Empty;
}
- /// <summary>
- /// Sends a message to the incoming connection id associated with the <see cref="PersistentConnection"/>.
- /// </summary>
- /// <param name="value">The value to send</param>
- /// <returns>A <see cref="Task"/> that represents when the send is complete.</returns>
- public Task Send(object value)
- {
- OnSending();
- return Connection.Send(_transport.ConnectionId, value);
- }
-
private Task ProcessNegotiationRequest(HostContext context)
{
var payload = new
@@ -308,14 +292,6 @@ private ITransport GetTransport(HostContext context)
return _transportManager.GetTransport(context);
}
- private static void OnSending()
- {
- if (Sending != null)
- {
- Sending();
- }
- }
-
private static void OnReceiving()
{
if (Receiving != null)
View
4 samples/SignalR.Hosting.AspNet.Samples/Raw/Raw.cs
@@ -47,7 +47,7 @@ protected override Task OnReceivedAsync(string connectionId, string data)
});
break;
case MessageType.Send:
- Send(new
+ Connection.Send(connectionId, new
{
type = MessageType.Send,
from = GetUser(connectionId),
@@ -58,7 +58,7 @@ protected override Task OnReceivedAsync(string connectionId, string data)
string name = message.Value;
_clients[connectionId] = name;
_users[name] = connectionId;
- Send(new
+ Connection.Send(connectionId, new
{
type = MessageType.Join,
data = message.Value
Please sign in to comment.
Something went wrong with that request. Please try again.