Class: Connection

Connection()

new Connection()

Init base elements necessary for work
Source:

Methods

changeChatForm(text)

Render new message on form
Parameters:
Name Type Description
text String html structure, that contains message
Source:

connectNewUser(username)

Parameters:
Name Type Description
username String The name of the user who connected to the chat
Source:

disconnectUser(username)

Parameters:
Name Type Description
username String The name of the user who disconnected from the chat
Source:

(async) getAuthData()

Get user's input data from authorization form and run `webSoketsWork` method
Source:

getMessage(msg)

Method, that get sent message. And draw it on form
Parameters:
Name Type Description
msg Object received message
Source:

runEventHandlers()

Launching event handlers necessary for operation
Source:

sendUserMessage()

Method, that send message
Source:

webSocketsWork()

Establishing a connection and launching event handlers necessary for operation
Source: