Giter Club home page Giter Club logo

stompnet's Issues

Incorrect behaviour in SerialTaskExecutor then queued task is faulted

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);
		}
	}
}

.net standard 2

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.

rabbitmq stomp connection issue

when i try to connect rabbitmq's stomp, the problem occur "HTTP/1.1 400 Bad Request' is not a valid STOMP server command".

Facing issue with StompNet library

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

Fails to connect on a secure connection (https)

A secure connection to RabbitMq using Https is failing. (using Http does connect)

This is the stack trace:

System.IO.EndOfStreamException: Poging voorbij het einde van de stroom te lezen.
   bij StompNet.IO.AsyncStreamReader.<ReadNBytesAsync>d__10.MoveNext() in E:\workspace\StompNet\StompNet\IO\AsyncStreamReader.cs:regel 91
--- Einde van stacktracering vanaf vorige locatie waar uitzondering is opgetreden ---
   bij System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   bij StompNet.IO.AsyncStreamReader.<ReadCharAsync>d__12.MoveNext() in E:\workspace\StompNet\StompNet\IO\AsyncStreamReader.cs:regel 113
--- Einde van stacktracering vanaf vorige locatie waar uitzondering is opgetreden ---
   bij System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   bij StompNet.IO.AsyncStreamReader.<ReadLineAsync>d__16.MoveNext() in E:\workspace\StompNet\StompNet\IO\AsyncStreamReader.cs:regel 160
--- Einde van stacktracering vanaf vorige locatie waar uitzondering is opgetreden ---
   bij System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   bij System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   bij StompNet.IO.Stomp12FrameReader.<ReadCommandAsync>d__8.MoveNext() in E:\workspace\StompNet\StompNet\IO\Stomp12FrameReader.cs:regel 99
--- Einde van stacktracering vanaf vorige locatie waar uitzondering is opgetreden ---
   bij System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   bij System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   bij StompNet.IO.Stomp12FrameReader.<ReadFrameAsyncImpl>d__7.MoveNext() in E:\workspace\StompNet\StompNet\IO\Stomp12FrameReader.cs:regel 78
--- Einde van stacktracering vanaf vorige locatie waar uitzondering is opgetreden ---
   bij System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   bij System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   bij StompNet.IO.Stomp12FrameReader.<ReadFrameAsync>d__6.MoveNext() in E:\workspace\StompNet\StompNet\IO\Stomp12FrameReader.cs:regel 68
--- Einde van stacktracering vanaf vorige locatie waar uitzondering is opgetreden ---
   bij System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   bij StompNet.IO.StompFrameObservable.<ReadFrames>d__9.MoveNext() in E:\workspace\StompNet\StompNet\IO\StompFrameObservable.cs:regel 84

Unfortunately MS still has not solved the translated exceptions issue. so the top exception translates to:
Attempt to read past the end of the stream.

Maybe put this in the readme.md to save some fellow developers time when looking for a suitable solution, or attract their interest to contribute:

Implemented so far:

  • Http

Not yet supported:

  • Https
  • Websockets
  • Websockets over Https

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.