Upcoming Games

(UTC times)


Full list
Add a game

Upcoming Events

No events to display

Who's Online

STOMP 1.1 - either CONNECT or STOMP should connect, right

You are here: Home > Forum > Customising SimSig > Interface Gateway > STOMP 1.1 - either CONNECT or STOMP should connect, right

Page 1 of 1

STOMP 1.1 - either CONNECT or STOMP should connect, right 11/03/2021 at 15:47 #137740
DonRiver
Avatar
164 posts
Having a lot of !!fun!! getting `stomp.py` to work with SimSig in the year 2021, but I think I've cracked it now.

In the STOMP 1.1 specs, which are confusing the heck out of me to be honest - it says 1.1 clients SHOULD send a `CONNECT` command to the server to remain compatible with STOMP 1.0 servers. And 1.1 servers SHOULD accept a `STOMP` command as equivalent to a `CONNECT` command:

https://stomp.github.io/stomp-specification-1.1.html#CONNECT_or_STOMP_Frame

Of course in the preceding paragraph it says that 1.1 clients send a CONNECT command to connect... what

`stomp.py`'s 1.1 connection will send a STOMP command to connect, while SimSig refuses the connection and says it expects a CONNECT command. If (if) I've understood the specs right, `stomp.py` should be sending the CONNECT command for 1.1 and also SimSig should accept STOMP command... right?

I see in Headshot117's example code from five years ago, it doesn't use `stomp.py`'s built-in `connect()` method but has a handcrafted connect frame, presumably for this reason. However `stomp.py`'s changed since then and this method no longer works.

It's a one-word change in `stomp.py`'s source code to have its 1.1 protocol use CONNECT instead of STOMP. I'll look deeper and see if there's some config I've missed to have it do this naturally, and if not, I'll submit a pull request to let this be configurable by the user.

But just for redundancy and strict adherence to the specs - should SimSig be made to digest STOMP commands as CONNECT commands?

Very confused by this but am making good progress overall!

(named for the one in Tasmania, not in Russia)
Log in to reply
STOMP 1.1 - either CONNECT or STOMP should connect, right 11/03/2021 at 20:12 #137747
GeoffM
Avatar
6367 posts
I had to write the Delphi implementation from scratch as there was no such implementation at the time, and I did not implement everything. Looking at the spec, it does seem a little ambiguous which is probably why STOMP (the command) didn't happen. Even now, I'm looking at it and wondering if they're saying CONNECT and STOMP are identical? If they're not, then it's somewhat vague.

If they are indeed the same then I guess that's an easy fix at the SimSig end.

SimSig Boss
Log in to reply
STOMP 1.1 - either CONNECT or STOMP should connect, right 11/03/2021 at 20:47 #137748
DonRiver
Avatar
164 posts
Thanks Geoff, that would be appreciated! An easy fix on the client side too - I've submitted a pull request to stomp.py to make it generally available.

Well, "easy" after spending a couple of hours staring at error messages and hopping around the library code ;)

Assuming the library author is happy with the pull request and it reached the world at large soon, I'll be able to provide an updated "hello world" that will just work straightaway.

My understanding is they moved from CONNECT to STOMP in 1.1 to make the messages easier to identify in Wireshark etc for network debugging... I'm quite happy to not have any use for Wireshark to be honest

(named for the one in Tasmania, not in Russia)
Last edited: 11/03/2021 at 20:48 by DonRiver
Reason: None given

Log in to reply