Solved

Understanding websocket example in spring

Posted on 2016-09-27
1
41 Views
Last Modified: 2016-10-14
HI,
I am using hte websocket example on : https://spring.io/guides/gs/messaging-stomp-websocket/
when i click on the connect button on the web page which loads when this application code is run the following code executes :
function connect() {
    var socket = new SockJS('/gs-guide-websocket');
    stompClient = Stomp.over(socket);
    stompClient.connect({}, function (frame) {
        setConnected(true);
        console.log('Connected: ' + frame);
        stompClient.subscribe('/topic/greetings', function (greeting) {
            showGreeting(JSON.parse(greeting.body).content);
        });
    });
}

Open in new window


And i see the following two network calls in the Network tab of chrome :
http://localhost:8080/gs-guide-websocket/info?t=1474970676486
ws://localhost:8080/gs-guide-websocket/614/vbxj5iok/websocket

What do these mean and what are there purpose... what are the things in bold means and where did they come from ?


Thanks
0
Comment
Question by:Rohit Bajaj
1 Comment
 
LVL 35

Accepted Solution

by:
Kimputer earned 500 total points
Comment Utility
When using a framework, api or other services that are meant to make things easy, you usually don't look under the hood too much. It's why you are using it in the first place, to make things easy for you.
In this case, you should check the request and the response (input name, get "hello name" back), if that's expected or not. Not really dig so deep as to what it's really sending in and out. The requests are all taken care of the backbone (in your case Spring.io), and the programmers could tell you the specifics but it would probably take quite some time for you to understand.
Usually it's a combination of time, randomness, and things to track.
0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Suggested Solutions

Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Viewers learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…
The viewer will learn how to implement Singleton Design Pattern in Java.

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now