I have been having a similar problem for a few months now, I put it down to my rural connection as I live in quite a remote area, but I realized it is most likely something to do with GW2, I can log in fine, but within a few moments of playing I get disconnected. Not just from the game itself, from my entire internet.
I’m connecting to the internet via a wifi dongle that connects to my router, so perhaps that is something to do with it. Either way from looking at this, it’s most likely something to do with GW2.