How to implement my own method in WebSocket in WebApi Core 2
up vote
0
down vote
favorite
It is possible to implement in websocket my own method, and call it like
socket = new WebSocket(connectionUrl);
socket.DoSomething() ?
c# .net websocket asp.net-core-webapi
add a comment |
up vote
0
down vote
favorite
It is possible to implement in websocket my own method, and call it like
socket = new WebSocket(connectionUrl);
socket.DoSomething() ?
c# .net websocket asp.net-core-webapi
1
Use SignalR instead
– Foo
Nov 22 at 14:19
SignalR works like WebSocket? Can i use it for fast communication?
– Drakoo
Nov 23 at 8:42
And I can use signalR only in the same application?
– Drakoo
Nov 23 at 9:51
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
It is possible to implement in websocket my own method, and call it like
socket = new WebSocket(connectionUrl);
socket.DoSomething() ?
c# .net websocket asp.net-core-webapi
It is possible to implement in websocket my own method, and call it like
socket = new WebSocket(connectionUrl);
socket.DoSomething() ?
c# .net websocket asp.net-core-webapi
c# .net websocket asp.net-core-webapi
edited Nov 22 at 14:19
Foo
1
1
asked Nov 22 at 14:17
Drakoo
10610
10610
1
Use SignalR instead
– Foo
Nov 22 at 14:19
SignalR works like WebSocket? Can i use it for fast communication?
– Drakoo
Nov 23 at 8:42
And I can use signalR only in the same application?
– Drakoo
Nov 23 at 9:51
add a comment |
1
Use SignalR instead
– Foo
Nov 22 at 14:19
SignalR works like WebSocket? Can i use it for fast communication?
– Drakoo
Nov 23 at 8:42
And I can use signalR only in the same application?
– Drakoo
Nov 23 at 9:51
1
1
Use SignalR instead
– Foo
Nov 22 at 14:19
Use SignalR instead
– Foo
Nov 22 at 14:19
SignalR works like WebSocket? Can i use it for fast communication?
– Drakoo
Nov 23 at 8:42
SignalR works like WebSocket? Can i use it for fast communication?
– Drakoo
Nov 23 at 8:42
And I can use signalR only in the same application?
– Drakoo
Nov 23 at 9:51
And I can use signalR only in the same application?
– Drakoo
Nov 23 at 9:51
add a comment |
1 Answer
1
active
oldest
votes
up vote
0
down vote
Do you mean extension method?
Yes, you can do it:
public static class WebSocketExtension
{
public static void DoSomething(this WebSocket socket)
{
// Do something
}
}
More about extensions
And I can use this method in my client on front-end after connect to websocket? I think I will not see this method in JS.
– Drakoo
Nov 23 at 9:20
You are correct, but You didin't include this litle requierement in question (or I didin't notice it).
– garret
Nov 27 at 9:04
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
Do you mean extension method?
Yes, you can do it:
public static class WebSocketExtension
{
public static void DoSomething(this WebSocket socket)
{
// Do something
}
}
More about extensions
And I can use this method in my client on front-end after connect to websocket? I think I will not see this method in JS.
– Drakoo
Nov 23 at 9:20
You are correct, but You didin't include this litle requierement in question (or I didin't notice it).
– garret
Nov 27 at 9:04
add a comment |
up vote
0
down vote
Do you mean extension method?
Yes, you can do it:
public static class WebSocketExtension
{
public static void DoSomething(this WebSocket socket)
{
// Do something
}
}
More about extensions
And I can use this method in my client on front-end after connect to websocket? I think I will not see this method in JS.
– Drakoo
Nov 23 at 9:20
You are correct, but You didin't include this litle requierement in question (or I didin't notice it).
– garret
Nov 27 at 9:04
add a comment |
up vote
0
down vote
up vote
0
down vote
Do you mean extension method?
Yes, you can do it:
public static class WebSocketExtension
{
public static void DoSomething(this WebSocket socket)
{
// Do something
}
}
More about extensions
Do you mean extension method?
Yes, you can do it:
public static class WebSocketExtension
{
public static void DoSomething(this WebSocket socket)
{
// Do something
}
}
More about extensions
answered Nov 23 at 8:16
garret
755513
755513
And I can use this method in my client on front-end after connect to websocket? I think I will not see this method in JS.
– Drakoo
Nov 23 at 9:20
You are correct, but You didin't include this litle requierement in question (or I didin't notice it).
– garret
Nov 27 at 9:04
add a comment |
And I can use this method in my client on front-end after connect to websocket? I think I will not see this method in JS.
– Drakoo
Nov 23 at 9:20
You are correct, but You didin't include this litle requierement in question (or I didin't notice it).
– garret
Nov 27 at 9:04
And I can use this method in my client on front-end after connect to websocket? I think I will not see this method in JS.
– Drakoo
Nov 23 at 9:20
And I can use this method in my client on front-end after connect to websocket? I think I will not see this method in JS.
– Drakoo
Nov 23 at 9:20
You are correct, but You didin't include this litle requierement in question (or I didin't notice it).
– garret
Nov 27 at 9:04
You are correct, but You didin't include this litle requierement in question (or I didin't notice it).
– garret
Nov 27 at 9:04
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53432926%2fhow-to-implement-my-own-method-in-websocket-in-webapi-core-2%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
1
Use SignalR instead
– Foo
Nov 22 at 14:19
SignalR works like WebSocket? Can i use it for fast communication?
– Drakoo
Nov 23 at 8:42
And I can use signalR only in the same application?
– Drakoo
Nov 23 at 9:51