• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Rob Spoor
  • Devaka Cooray
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
  • Tim Holloway
Bartenders:
  • Jj Roberts
  • Al Hobbs
  • Piet Souris

Java WebSocket difference between server endpoint and client endpoint

 
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,
As for now I understand what is WebSocket, what is the use for it. But I can't fully understand what is difference between server endpoint and client endpoint. I tried to read many of tutorials about this, but I don't now why, but they didn't helped me to understand. I think that maybe all of them starts with ServerEndpoint, gives some explanation about it, but when it comes to ClientEndpoint, they just says: "now let's implement client side endpoint" and gives code of fully implemented ClientEndpoint. But doesn't give explanation, why we need it, what it does, why ServerEndpoint is not enough and etc.
I would be really grateful if you could help me .
 
Marshal
Posts: 3708
523
Android Eclipse IDE TypeScript Redhat MicroProfile Quarkus Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Establishment of a Websocket connection uses client-server protocol (HTTP), so the purpose of establishing the connection, client and server endpoints need to behave differently.  The client-side endpoint initiates the connection establishment by sending a request to the server-side endpoint, and the server-side endpoint (which is listening for incoming requests) responds back to complete the connection establishment.

After that connection has been established, communications between the two endpoint are peer-to-peer (although the protocols layered on top of the bi-directional communications channel may use a client-server model).

 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic