SignalR recieve stop message on server from client. [closed]
On my client I want to send a message to the server letting the server know the client is no longer listening. I would like to call something like
signalRConnection.Stop(uniqueConnectionIdentifier)
Where uniqueConnectionIdentifier is a something unique to that signalRConnection. Is there a way to send this message back to the server when stopping the signalRConnection from the server?
c# asp.net signalr signalr-hub signalr.client
closed as too broad by Vadim Gremyachev, Dmitry, Nic3500, thewaywewere, Sterling Archer Mar 24 at 20:10
Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.
add a comment |
On my client I want to send a message to the server letting the server know the client is no longer listening. I would like to call something like
signalRConnection.Stop(uniqueConnectionIdentifier)
Where uniqueConnectionIdentifier is a something unique to that signalRConnection. Is there a way to send this message back to the server when stopping the signalRConnection from the server?
c# asp.net signalr signalr-hub signalr.client
closed as too broad by Vadim Gremyachev, Dmitry, Nic3500, thewaywewere, Sterling Archer Mar 24 at 20:10
Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.
add a comment |
On my client I want to send a message to the server letting the server know the client is no longer listening. I would like to call something like
signalRConnection.Stop(uniqueConnectionIdentifier)
Where uniqueConnectionIdentifier is a something unique to that signalRConnection. Is there a way to send this message back to the server when stopping the signalRConnection from the server?
c# asp.net signalr signalr-hub signalr.client
On my client I want to send a message to the server letting the server know the client is no longer listening. I would like to call something like
signalRConnection.Stop(uniqueConnectionIdentifier)
Where uniqueConnectionIdentifier is a something unique to that signalRConnection. Is there a way to send this message back to the server when stopping the signalRConnection from the server?
c# asp.net signalr signalr-hub signalr.client
c# asp.net signalr signalr-hub signalr.client
asked Jan 3 at 13:45
JayBateJayBate
123
123
closed as too broad by Vadim Gremyachev, Dmitry, Nic3500, thewaywewere, Sterling Archer Mar 24 at 20:10
Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.
closed as too broad by Vadim Gremyachev, Dmitry, Nic3500, thewaywewere, Sterling Archer Mar 24 at 20:10
Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
You can send specific data (like string, int ) which is not from your regular signals.
The client can use this data to initiate disconnect from the server.
For ex. in below example, "kickedout" string is sent by server whenever server wants to kickout a client.
void OnReceive(string data)
{
if(data.Equals("kickedout"))
{
connection.Stop();
return;
}
Console.WriteLine(data);
}
I need the client to initiate the process with a message. Think of a phone closing an application and i need to decrease a counter of the amount of clients for a particular area of that application. Area A of the app has 3, area B has 5. When a phone was subscribed to area A and sends the disconnect signal with an are A identifier i need it to decrease the area A counter.
– JayBate
Jan 3 at 14:21
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
You can send specific data (like string, int ) which is not from your regular signals.
The client can use this data to initiate disconnect from the server.
For ex. in below example, "kickedout" string is sent by server whenever server wants to kickout a client.
void OnReceive(string data)
{
if(data.Equals("kickedout"))
{
connection.Stop();
return;
}
Console.WriteLine(data);
}
I need the client to initiate the process with a message. Think of a phone closing an application and i need to decrease a counter of the amount of clients for a particular area of that application. Area A of the app has 3, area B has 5. When a phone was subscribed to area A and sends the disconnect signal with an are A identifier i need it to decrease the area A counter.
– JayBate
Jan 3 at 14:21
add a comment |
You can send specific data (like string, int ) which is not from your regular signals.
The client can use this data to initiate disconnect from the server.
For ex. in below example, "kickedout" string is sent by server whenever server wants to kickout a client.
void OnReceive(string data)
{
if(data.Equals("kickedout"))
{
connection.Stop();
return;
}
Console.WriteLine(data);
}
I need the client to initiate the process with a message. Think of a phone closing an application and i need to decrease a counter of the amount of clients for a particular area of that application. Area A of the app has 3, area B has 5. When a phone was subscribed to area A and sends the disconnect signal with an are A identifier i need it to decrease the area A counter.
– JayBate
Jan 3 at 14:21
add a comment |
You can send specific data (like string, int ) which is not from your regular signals.
The client can use this data to initiate disconnect from the server.
For ex. in below example, "kickedout" string is sent by server whenever server wants to kickout a client.
void OnReceive(string data)
{
if(data.Equals("kickedout"))
{
connection.Stop();
return;
}
Console.WriteLine(data);
}
You can send specific data (like string, int ) which is not from your regular signals.
The client can use this data to initiate disconnect from the server.
For ex. in below example, "kickedout" string is sent by server whenever server wants to kickout a client.
void OnReceive(string data)
{
if(data.Equals("kickedout"))
{
connection.Stop();
return;
}
Console.WriteLine(data);
}
answered Jan 3 at 13:53
Manoj ChoudhariManoj Choudhari
2,3741721
2,3741721
I need the client to initiate the process with a message. Think of a phone closing an application and i need to decrease a counter of the amount of clients for a particular area of that application. Area A of the app has 3, area B has 5. When a phone was subscribed to area A and sends the disconnect signal with an are A identifier i need it to decrease the area A counter.
– JayBate
Jan 3 at 14:21
add a comment |
I need the client to initiate the process with a message. Think of a phone closing an application and i need to decrease a counter of the amount of clients for a particular area of that application. Area A of the app has 3, area B has 5. When a phone was subscribed to area A and sends the disconnect signal with an are A identifier i need it to decrease the area A counter.
– JayBate
Jan 3 at 14:21
I need the client to initiate the process with a message. Think of a phone closing an application and i need to decrease a counter of the amount of clients for a particular area of that application. Area A of the app has 3, area B has 5. When a phone was subscribed to area A and sends the disconnect signal with an are A identifier i need it to decrease the area A counter.
– JayBate
Jan 3 at 14:21
I need the client to initiate the process with a message. Think of a phone closing an application and i need to decrease a counter of the amount of clients for a particular area of that application. Area A of the app has 3, area B has 5. When a phone was subscribed to area A and sends the disconnect signal with an are A identifier i need it to decrease the area A counter.
– JayBate
Jan 3 at 14:21
add a comment |