question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

New feature: implement SendRequest

See original GitHub issue

hi jchristin, I’m new to github, I’ve found your library very useful for my next project. It’s very easy to use and works very good. I would like see in your WatsonTcpClient class an implementation of a method like this

byte[] SendRequest(Dictionary<object,object>, string data)

When the client sends this message it will wait for the response and then provide the response as return value.

When the server receives the Request it fires an event and after event management sends the response to the client.

Who manages the server event must set the response in a property of eventargs. Also the server have to respond very quickly 😃

I think that in this case the communication between the client and the server will be synchronous, i cannot send to server other requests until the current has no response.

I don’t know if this is a good idea but this implementation makes the TCP calls more similar to method calls.

let me know what do you think about

Thanks

Ozrecsec

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:31 (20 by maintainers)

github_iconTop GitHub Comments

2reactions
jchristncommented, Mar 23, 2020

Ok I think I have a solution here. The issue was around conversion to UTC. I don’t know, however, if this fix will break the fix I put in for @ozrecsec so I’ll need confirmation. Also both Test.Client and Test.Server now have a command called sendandwait empty for this purpose.

image

NuGet v3.1.3: https://www.nuget.org/packages/WatsonTcp/3.1.3 Commit: https://github.com/jchristn/WatsonTcp/commit/495cffc36e069b7c0234f8ea3fc659b2a6273724

Please let me know if any issues either way.

2reactions
jchristncommented, Mar 21, 2020

Hi @ozrecsec let me know what you think 😃

NuGet v3.1.0: https://www.nuget.org/packages/WatsonTcp/3.1.0 Commit: https://github.com/jchristn/WatsonTcp/commit/841d9fc11ae6a1a32d6888be9a1847f66a87d81a

Updated README.md has examples, as do the Test.Client and Test.Server projects.

Read more comments on GitHub >

github_iconTop Results From Across the Web

extension.sendRequest() - Mozilla - MDN Web Docs
Sends a request to other listeners within the extension. Similar to runtime.connect, but only sends a request with an optional response.
Read more >
Postman JavaScript reference
Sending requests from scripts. You can use the pm.sendRequest method to send a request asynchronously from a Pre-request or Test script. This ...
Read more >
system.util.sendRequest - Ignition User Manual 7.9
The following feature is new in Ignition version 7.9.3 ... Use "payload" in the message handler to access dictionary variables.
Read more >
How to use sendRequest · Issue #194 · microsoft/vscode- ...
Hi, I want to provide a function in client side that calls a function implemented in the server side using sendRequest function, ...
Read more >
postman sendRequest use authorization from collection
I can send a request in a Postman pre-request script as seen below. What I would like to do is use the same...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found