Python SignalR Client Application - How to get the ConnectionId after connection to SignalR HubHow do I connect to a MySQL Database in Python?How to get the current time in PythonHow can I get the application's path in a .NET console application?How do I get the number of elements in a list in Python?SignalR: how to enforce authentication/terminate hub connections server sideSignalR WPF Client can't reach hub deployed on IIS when IIS runs on a different systemSignalR .net client connects to hub, but can't hubProxy.Invoke()how to handle multiple signalr hub in a silverlight LOB applicationCreating multiple Signalr hub proxies in a .Net clientHow to pass Custom Header from React JS client to SignalR hub?

My first c++ game (snake console game)

Has the Hulk always been able to talk?

Gerrymandering Puzzle - Rig the Election

Start job from another SQL server instance

Which sphere is fastest?

Are there terms in German for different skull shapes?

Would you use "llamarse" for an animal's name?

What was Bran's plan to kill the Night King?

How can I get people to remember my character's gender?

Can you use "едать" and "игрывать" in the present and future tenses?

Is there a word for food that's gone 'bad', but is still edible?

Checking if two expressions are related

Dangerous workplace travelling

How to deal with employer who keeps me at work after working hours

Should I mention being denied entry to UK due to a confusion in my Visa and Ticket bookings?

Any examples of liquids volatile at room temp but non-flammable?

Endgame puzzle: How to avoid stalemate and win?

How long would it take for people to notice a mass disappearance?

Agena docking and RCS Brakes in First Man

Why would a military not separate its forces into different branches?

Is it normal for gliders not to have attitude indicators?

Why is "breaking the mould" positively connoted?

Is there precedent or are there procedures for a US president refusing to concede to an electoral defeat?

Why do these characters still seem to be the same age after the events of Endgame?



Python SignalR Client Application - How to get the ConnectionId after connection to SignalR Hub


How do I connect to a MySQL Database in Python?How to get the current time in PythonHow can I get the application's path in a .NET console application?How do I get the number of elements in a list in Python?SignalR: how to enforce authentication/terminate hub connections server sideSignalR WPF Client can't reach hub deployed on IIS when IIS runs on a different systemSignalR .net client connects to hub, but can't hubProxy.Invoke()how to handle multiple signalr hub in a silverlight LOB applicationCreating multiple Signalr hub proxies in a .Net clientHow to pass Custom Header from React JS client to SignalR hub?






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;








0















First time poster. This is my first experience developing a microservice using .NET. Clients will use a REST API to request the service, the API will use the microservice to get results and send back to clients. The REST API is going to use SignalR to return data using a callback. There are two clients applications expected, one will be developed in .NET and another in PYTHON to consumer the service. I'm able to do a successful test using .NET client (using Microsoft.AspNet.SignalR.Client), however when I try with PYTHON client (using signalr-client), I'm not able to trigger callback from API for the specific client (if I send response to ALL clients that works). The reason I believe is that in .NET client application, after connecting to HUB, I can get ConnectionId using HubConnection.ConnectionId. Then when I make REST API call, I pass same ConnectionId and API uses the ConnectionId to send response using SignalR. However in PYTHON client, I can't find the ConnectionId attribute in Connection object. Does someone know how can I get ConnectionId in PYTHON client (or is there some other approach I need to follow).



This is the .NET client which works




HttpClient client = new HttpClient();
HubConnection hubConnection = new HubConnection("http://localhost:12247");
var hubProxy = hubConnection.CreateHubProxy("MyTestHub");
Action<string> onUpdate = str => System.Console.WriteLine($"received: str");

hubConnection.Start()
.ContinueWith(t =>

hubProxy.On("OnUpdateCallback", onUpdate);
).Wait();

var guid = Guid.Parse(hubConnection.ConnectionId);
var response = client.PostAsJsonAsync("http://localhost:12247/api/Values", guid).Result;
System.Console.ReadLine();



This is the PYTHON client, but how to find the ConnectionId




with Session() as session:
connection = Connection("http://localhost:12247/signalr", session)
hub = connection.register_hub('MyTestHub')
connection.start()

def onUpdate(data):
print('received: ' + str(data))

hub.client.on('OnUpdateCallback', onUpdate)

with connection:
response = requests.post("http://localhost:12247/api/Values", json=???) #how to find connectionid

sys.stdin.readline()










share|improve this question




























    0















    First time poster. This is my first experience developing a microservice using .NET. Clients will use a REST API to request the service, the API will use the microservice to get results and send back to clients. The REST API is going to use SignalR to return data using a callback. There are two clients applications expected, one will be developed in .NET and another in PYTHON to consumer the service. I'm able to do a successful test using .NET client (using Microsoft.AspNet.SignalR.Client), however when I try with PYTHON client (using signalr-client), I'm not able to trigger callback from API for the specific client (if I send response to ALL clients that works). The reason I believe is that in .NET client application, after connecting to HUB, I can get ConnectionId using HubConnection.ConnectionId. Then when I make REST API call, I pass same ConnectionId and API uses the ConnectionId to send response using SignalR. However in PYTHON client, I can't find the ConnectionId attribute in Connection object. Does someone know how can I get ConnectionId in PYTHON client (or is there some other approach I need to follow).



    This is the .NET client which works




    HttpClient client = new HttpClient();
    HubConnection hubConnection = new HubConnection("http://localhost:12247");
    var hubProxy = hubConnection.CreateHubProxy("MyTestHub");
    Action<string> onUpdate = str => System.Console.WriteLine($"received: str");

    hubConnection.Start()
    .ContinueWith(t =>

    hubProxy.On("OnUpdateCallback", onUpdate);
    ).Wait();

    var guid = Guid.Parse(hubConnection.ConnectionId);
    var response = client.PostAsJsonAsync("http://localhost:12247/api/Values", guid).Result;
    System.Console.ReadLine();



    This is the PYTHON client, but how to find the ConnectionId




    with Session() as session:
    connection = Connection("http://localhost:12247/signalr", session)
    hub = connection.register_hub('MyTestHub')
    connection.start()

    def onUpdate(data):
    print('received: ' + str(data))

    hub.client.on('OnUpdateCallback', onUpdate)

    with connection:
    response = requests.post("http://localhost:12247/api/Values", json=???) #how to find connectionid

    sys.stdin.readline()










    share|improve this question
























      0












      0








      0








      First time poster. This is my first experience developing a microservice using .NET. Clients will use a REST API to request the service, the API will use the microservice to get results and send back to clients. The REST API is going to use SignalR to return data using a callback. There are two clients applications expected, one will be developed in .NET and another in PYTHON to consumer the service. I'm able to do a successful test using .NET client (using Microsoft.AspNet.SignalR.Client), however when I try with PYTHON client (using signalr-client), I'm not able to trigger callback from API for the specific client (if I send response to ALL clients that works). The reason I believe is that in .NET client application, after connecting to HUB, I can get ConnectionId using HubConnection.ConnectionId. Then when I make REST API call, I pass same ConnectionId and API uses the ConnectionId to send response using SignalR. However in PYTHON client, I can't find the ConnectionId attribute in Connection object. Does someone know how can I get ConnectionId in PYTHON client (or is there some other approach I need to follow).



      This is the .NET client which works




      HttpClient client = new HttpClient();
      HubConnection hubConnection = new HubConnection("http://localhost:12247");
      var hubProxy = hubConnection.CreateHubProxy("MyTestHub");
      Action<string> onUpdate = str => System.Console.WriteLine($"received: str");

      hubConnection.Start()
      .ContinueWith(t =>

      hubProxy.On("OnUpdateCallback", onUpdate);
      ).Wait();

      var guid = Guid.Parse(hubConnection.ConnectionId);
      var response = client.PostAsJsonAsync("http://localhost:12247/api/Values", guid).Result;
      System.Console.ReadLine();



      This is the PYTHON client, but how to find the ConnectionId




      with Session() as session:
      connection = Connection("http://localhost:12247/signalr", session)
      hub = connection.register_hub('MyTestHub')
      connection.start()

      def onUpdate(data):
      print('received: ' + str(data))

      hub.client.on('OnUpdateCallback', onUpdate)

      with connection:
      response = requests.post("http://localhost:12247/api/Values", json=???) #how to find connectionid

      sys.stdin.readline()










      share|improve this question














      First time poster. This is my first experience developing a microservice using .NET. Clients will use a REST API to request the service, the API will use the microservice to get results and send back to clients. The REST API is going to use SignalR to return data using a callback. There are two clients applications expected, one will be developed in .NET and another in PYTHON to consumer the service. I'm able to do a successful test using .NET client (using Microsoft.AspNet.SignalR.Client), however when I try with PYTHON client (using signalr-client), I'm not able to trigger callback from API for the specific client (if I send response to ALL clients that works). The reason I believe is that in .NET client application, after connecting to HUB, I can get ConnectionId using HubConnection.ConnectionId. Then when I make REST API call, I pass same ConnectionId and API uses the ConnectionId to send response using SignalR. However in PYTHON client, I can't find the ConnectionId attribute in Connection object. Does someone know how can I get ConnectionId in PYTHON client (or is there some other approach I need to follow).



      This is the .NET client which works




      HttpClient client = new HttpClient();
      HubConnection hubConnection = new HubConnection("http://localhost:12247");
      var hubProxy = hubConnection.CreateHubProxy("MyTestHub");
      Action<string> onUpdate = str => System.Console.WriteLine($"received: str");

      hubConnection.Start()
      .ContinueWith(t =>

      hubProxy.On("OnUpdateCallback", onUpdate);
      ).Wait();

      var guid = Guid.Parse(hubConnection.ConnectionId);
      var response = client.PostAsJsonAsync("http://localhost:12247/api/Values", guid).Result;
      System.Console.ReadLine();



      This is the PYTHON client, but how to find the ConnectionId




      with Session() as session:
      connection = Connection("http://localhost:12247/signalr", session)
      hub = connection.register_hub('MyTestHub')
      connection.start()

      def onUpdate(data):
      print('received: ' + str(data))

      hub.client.on('OnUpdateCallback', onUpdate)

      with connection:
      response = requests.post("http://localhost:12247/api/Values", json=???) #how to find connectionid

      sys.stdin.readline()







      c# python .net signalr microservices






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Mar 23 at 1:05









      SyedSyed

      11




      11






















          0






          active

          oldest

          votes












          Your Answer






          StackExchange.ifUsing("editor", function ()
          StackExchange.using("externalEditor", function ()
          StackExchange.using("snippets", function ()
          StackExchange.snippets.init();
          );
          );
          , "code-snippets");

          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "1"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader:
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          ,
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );













          draft saved

          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55309629%2fpython-signalr-client-application-how-to-get-the-connectionid-after-connection%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown

























          0






          active

          oldest

          votes








          0






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes















          draft saved

          draft discarded
















































          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.




          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55309629%2fpython-signalr-client-application-how-to-get-the-connectionid-after-connection%23new-answer', 'question_page');

          );

          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







          Popular posts from this blog

          Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

          Swift 4 - func physicsWorld not invoked on collision? The Next CEO of Stack OverflowHow to call Objective-C code from Swift#ifdef replacement in the Swift language@selector() in Swift?#pragma mark in Swift?Swift for loop: for index, element in array?dispatch_after - GCD in Swift?Swift Beta performance: sorting arraysSplit a String into an array in Swift?The use of Swift 3 @objc inference in Swift 4 mode is deprecated?How to optimize UITableViewCell, because my UITableView lags

          Access current req object everywhere in Node.js ExpressWhy are global variables considered bad practice? (node.js)Using req & res across functionsHow do I get the path to the current script with Node.js?What is Node.js' Connect, Express and “middleware”?Node.js w/ express error handling in callbackHow to access the GET parameters after “?” in Express?Modify Node.js req object parametersAccess “app” variable inside of ExpressJS/ConnectJS middleware?Node.js Express app - request objectAngular Http Module considered middleware?Session variables in ExpressJSAdd properties to the req object in expressjs with Typescript