krlito / stompnet Goto Github PK
View Code? Open in Web Editor NEWAsynchronous STOMP 1.2 client library for .NET 4.5 and .NET Standard 1.5.
License: Apache License 2.0
Asynchronous STOMP 1.2 client library for .NET 4.5 and .NET Standard 1.5.
License: Apache License 2.0
We have a Websocket Stomp server built in Java (Spring based) hosted in localhost with 8080 port
We are facing an connectivity issue while using Stompclient library and getting following error -
Error list-
• Message = "This protocol version is not supported."
• DualMode = 'tcpClient.Client.DualMode' threw an exception of type 'System.NotSupportedException'
• tcpClient.Client.EnableBroadcast' threw an exception of type 'System.Net.Sockets.SocketException'
• An unknown, invalid, or unsupported option or level was specified in a getsockopt or setsockopt call
• base = {"This stream does not support seek operations."}
• HTTP/1.1 400 Bad Request' is not a valid STOMP server command.
Can anyone please suggest if you have successfully created / used any C# client library with a spring based STOMP over Web Socket server.
Please let us know if you need more details.
Appreciate your quick response..
Thanks
Vanita
Rather than a TCP connection, is there a way we can connect through a websocket connection?
Thanks
Jimmy
Hi, your lib works like a charm and the pull request from @Sbou too, plz accept the heartbeat, and publish a .net standard 2 on nuget, to run it in .net standard you don't need to change any line, your code is full compatible with it.
I faced with a problem, that when the exception is thrown in WriteAsync method of the IStompFrameWriter instance then the TaskCancellationSource returned by SerialTaskExecutor has always state of successfull completion of the queued task. By analyzing and debugging the extension method TrySet of the class TaskCompletionSourceExtensions I'm found what the faulted awaited task, has also flag IsCompleted, so your code is never set exception in the TaskCancellationSource.
So the correct code is:
/// <summary>
/// TaskCompletionSource extensions.
/// </summary>
internal static class TaskCompletionSourceExtensions
{
public static void TrySet<T>(this TaskCompletionSource<T> tcs, Task task) where T : class
{
if (task.IsFaulted)
{
tcs.TrySetException(task.Exception.InnerExceptions);
}
else if (task.IsCanceled)
{
tcs.TrySetCanceled();
}
else
{
Task<T> taskWithResult = task as Task<T>;
tcs.TrySetResult(taskWithResult == null ? null : taskWithResult.Result);
}
}
}
when i try to connect rabbitmq's stomp, the problem occur "HTTP/1.1 400 Bad Request' is not a valid STOMP server command".
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.