I'm new to stackoverflow.
I'm currently working on a WebSocket project and using a component called Alchemy-Websockets.
My question is when I trying to use Alchemy.WebSocketClient class like this :
var aClient = new WebSocketClient("ws://172.28.1.103:8100");
I got a FormatException error.
the documentation here :
http://alchemywebsockets.net/docs/class_alchemy_1_1_web_socket_client.html
didn't show any sample code.
so, could anyone gives me some help here?
TKS.
Jack here, maintainer of Alchemy. (We need to update our autogenerated docs.)
Try appending a channel to the end of your connection, like this:
var aClient = new WebSocketClient("ws://172.28.1.103:8100/channel");
Note the /channel on the end. The value can be anything. You can see an example in our integration tests: https://github.com/Olivine-Labs/Alchemy-Websockets/blob/master/test/Integration/Alchemy/ClientServer.cs
Related
So this is maybe dumb but I am using BitcoinLib for c# and I am trying to get to work this line:
IBitcoinService BitcoinService = new BitcoinService("https://localhost:5051/", "aaa" ,"aaa","vvvv", 5);
What I dont know: What to input there. I tried watching videos or documentation but theres anywhere said what website/password/acc and all to input. Then When I know what to input, how can I mine and then send bitcoins to my wallet? I know this is stupid but I really dont understand how to programate it...
What I tried: I have tried reading a documentation, I have tried watching some videos, downloading demo of app and nothing helped me. Either I am dumb or it's complicated.
Btw: I know how mining and bitcoin works (basics)
Configure your Bitcoin Core wallet properly in bitcoin.conf:
rpcuser = MyRpcUsername
rpcpassword = MyRpcPassword
server=1
txindex=1
Then you can just initiate the BitcoinService like that:
IBitcoinService BitcoinService = new BitcoinService();
and it will work; you don't need to explicitly define them inside the code. If you need to change these parameters in runtime you can do so by calling:
(IBitcoinService).Parameters
I'm trying to use SocketLite.PCL with my iOS/Android solution in Xamarin,
but I get the message Allow Multiple Bind To Same Port only allowed on Windows when running it.
What does it mean and how do I fix it?
EDIT:
Example code I'm using can be found here: https://github.com/1iveowl/SocketLite.PCL
I put the following code inside rotected async override void OnStart(){} of the app:
var udpReceived = new UdpSocketReceiver();
await udpReceived.StartListeningAsync(4992, allowMultipleBindToSamePort: true);
var udpMessageSubscriber = udpReceived.ObservableMessages.Subscribe(
msg =>
{
System.Console.WriteLine($"Remote adrres: {msg.RemoteAddress}");
System.Console.WriteLine($"Remote port: {msg.RemotePort}");
var str = System.Text.Encoding.UTF8.GetString(msg.ByteData);
System.Console.WriteLine($"Messsage: {str}");
},
ex =>
{
// Exceptions received here
}
);
EDIT 2:
Ok, so setting allowMultipleBindToSamePort to false stopped that error.
Now I get the error Address already in use.
However I am still curious as to what allowMultipleBindToSamePort is used for.
As you can see in the new documentation:
IMPORTANT: Please notice that the parameter allowMultipleBindToSamePort will only work on Windows. On other platforms it should be set to false
About However I am still curious as to what allowMultipleBindToSamePort is used for.
There is a good and complete explanation on this post, you can read more in the following stackoverflow post
I have a comment I would like to be able to modify but I am not sure how to process.
Here is what I've tried so far :
using Manatee.Trello;
public class MyClass
{
//identification is done beforehand as per Manatee.Trello's wiki
Card c = new Card(existingCardID);
foreach(Action comment in card.Comments)
{
comment.Data.Value="empty comment";
}
}
However, Action.Data.Value only has get capabilities. What is the correct way to update a comment data using this library?
Updated!
action.Data.Text = "updated comment";
You'll likely get an error from Trello if the action isn't a comment.
I'll add a note in the wiki. I realize it's a bit hidden.
Edit... 2, I guess.
I've recently published Manatee.Trello v1.16.0 which resolves this bug. Use it as indicated above.
i want to use a WSDL-Service, but i've never done this before. I have to use a certificate, but don't know how to implement this.
I did the following steps:
Added service reference
inserted the link to the online wsdl file
he got it and i selected O.K
Now i can use the namespace "ServiceReference1" in my project
When i want to call the Login-Method, then i get a error and vs tells me, that more informations are on the "faultDetailString." but how can i get these informations?
ServiceReference1.SessionWSIClient client = new ServiceReference1.SessionWSIClient();
string result = client.Login(this.transaktionsId, this.benutzerId, this.pin);
I'm trying to control a PTZ camera with the http://www.onvif.org/onvif/ver20/ptz/wsdl/ptz.wsdl file.
I can use the GotoPreset function without a problem but the ContinuousMove function throws an ProtocolException.
Page 77 of this guide shows an example of how the ConinuousMove function should be used.
Following this guide provided me with the following code:
OnvifMediaClient.Profile[] profs = this.mediaClient.GetProfiles();
OnvifMediaClient.Profile profile = mediaClient.GetProfile(profs[0].token);
OnvifPTZ.PTZConfigurationOptions options = PtzClient.GetConfigurationOptions(profile.token);
OnvifPTZ.PTZSpeed velocity = new OnvifPTZ.PTZSpeed();
velocity.PanTilt = new OnvifPTZ.Vector2D();
velocity.Zoom = new OnvifPTZ.Vector1D();
velocity.PanTilt.x = options.Spaces.ContinuousPanTiltVelocitySpace[0].XRange.Max;
velocity.PanTilt.y = options.Spaces.ContinuousPanTiltVelocitySpace[0].YRange.Max;
velocity.PanTilt.space = options.Spaces.ContinuousPanTiltVelocitySpace[0].URI;
velocity.Zoom.x = options.Spaces.ContinuousZoomVelocitySpace[0].XRange.Max;
velocity.Zoom.space = options.Spaces.ContinuousZoomVelocitySpace[0].URI;
PtzClient.ContinuousMove(profile.token, velocity, "1000");
Thread.Sleep(2000);
PtzClient.Stop(profile.token, true, true);
But there are some differences with the code in the guide, for example the actual ContinuousMove function requires 3 parameters in my code instead of 2 as in the guide. The extra parameter is a timeout so i think that won't make that much difference but maybe some other things are different that cause my code to fail.
I dit read the awnser of this question in wich the person said the PTZ camera didn't support the ver20. But when I add a service reference to the wsdl with ver20 changed to ver10 I get a message that adding the wsdl failed because it contains links that could not be resolved. Also when i paste the ver10 url (http://www.onvif.org/onvif/ver10/ptz/wsdl/ptz.wsdl) in my webbrowser it shows an xml instead of an wsdl.
How can I use the right wsdl file if i'm not using it already or what could resolve the behaviour in my current setup?
I found a solution.
It turns out I misunderstood the timeout parameter in PtzClient.ContunuousMove. In the previous wsdl version (ver10) you had to call the Stop function everytime you wanted the current PTZ action to stop. In ver20 of the wsdl the PTZ function (unless the Stop function is called) will last as long as specified in the timeout parameter. I thought it was a response timeout or something but it's not.
Calling ContinuousMove now looks like this:
PtzClient.ContinuousMove(profile.token, velocity, "PT1S");
Where the number in the string stands for the amount of seconds the PTZ action should last.
Hope it helps someone.