Chat applikasjon
Public Member Functions | List of all members
websocket.Websocket Class Reference

Public Member Functions

void onOpen (@PathParam("userId") String userId, @PathParam("username") String username, Session session)
 
void onClose (Session session)
 
void onMessage (String message, Session session)
 
void onError (Throwable error)
 

Detailed Description

Websocket server on server endpoint /websocket/{userId}/{username}

Member Function Documentation

◆ onClose()

void websocket.Websocket.onClose ( Session  session)
inline

Method called when client disconnects from websocket. Removes clients session.

Parameters
sessioninformation about clients session

◆ onError()

void websocket.Websocket.onError ( Throwable  error)
inline

Method used on error

Parameters
errorcontains information about error

◆ onMessage()

void websocket.Websocket.onMessage ( String  message,
Session  session 
)
inline

Method used when server receives message from client which is sent to specified user.

Parameters
messagemessage received from client
sessioninformation about clients session

◆ onOpen()

void websocket.Websocket.onOpen ( @PathParam("userId") String  userId,
@PathParam("username") String  username,
Session  session 
)
inline

Method called when client wants to establish connection with websocket

Parameters
userIdadded to session properties to link each session to a specific user
usernameadded to session properties to link each session to a specific user
sessioninformation about clients session

The documentation for this class was generated from the following file: