
- HTML Tutorial
- HTML - Home
- HTML - Overview
- HTML - Basic Tags
- HTML - Elements
- HTML - Attributes
- HTML - Formatting
- HTML - Phrase Tags
- HTML - Meta Tags
- HTML - Comments
- HTML - Images
- HTML - Tables
- HTML - Lists
- HTML - Text Links
- HTML - Image Links
- HTML - Email Links
- HTML - Frames
- HTML - Iframes
- HTML - Blocks
- HTML - Backgrounds
- HTML - Colors
- HTML - Fonts
- HTML - Forms
- HTML - Embed Multimedia
- HTML - Marquees
- HTML - Header
- HTML - Style Sheet
- HTML - Javascript
- HTML - Layouts
- HTML References
- HTML - Tags Reference
- HTML - Attributes Reference
- HTML - Events Reference
- HTML - Fonts Reference
- HTML - ASCII Codes
- ASCII Table Lookup
- HTML - Color Names
- HTML - Entities
- HTML - Fonts Ref
- HTML - Events Ref
- MIME Media Types
- HTML - URL Encoding
- Language ISO Codes
- HTML - Character Encodings
- HTML - Deprecated Tags
How to use sockets in JavaScriptHTML?
To use sockets, consider the WebSocket interface in JavaScript. This interface enables web applications to maintain bidirectional communications with server-side processes.
To enable Web applications to maintain bidirectional communications with server-side processes, this specification introduces the WebSocket interface.
Here are some of the methods to workaround with Web Sockets −
socket = new WebSocket(url [, protocols ] )
Create a new socket using this, wherein parameters URL is a string for the connection and protocols is a string or array of string.
socket . send( data )
The above is used to send data.
Used to close the socket connection.
socket . close( [ code ] [, reason ] )
The following returns the URL used to establish the connection.
socket . url
- Related Articles
- What is Sockets?
- Interprocess Communication with Sockets
- Advantages and Disadvantages of Java Sockets
- Sending and Receiving Data with Sockets in android
- Why are electric witches, plugs and sockets made of thermosetting plastics?
- How to use enums in C++?
- How to use Coalesce in MySQL?
- How to use Notification.deleteIntent in Android?
- How to use thread.sleep() in android?
- How to use CopyOnWriteArrayList in android?
- How to use in android CopyOnWriteArraySet?
- How to use LinkedBlockingDeque in android?
- How to use cardview in recyclerview?
- How to use findViewById in Fragment?
- How to use GridLayoutManager in RecyclerView?

Advertisements