Tag: java

60 votes
6 answers
2.3K views
getting the reason why websockets closed with close code 1006

I would like to get the reason websockets closed, so I can show the right message to the user. I have sok.on

avatar
Alba
0 1 0 9
asked 07 September, 2021
54 votes
6 answers
766 views
javax.websocket client simple example

Can someone please provide me very simple example of websocket client using javax.websocket? I want to connec

avatar
Boyd
0 1 0 9
asked 07 September, 2021
58 votes
7 answers
2.4K views
WebSocket: How to automatically reconnect after it dies

var ws = new WebSocket('ws://localhost:8080'); ws.onopen = function () { ws.send(JSON.stringify({

avatar
Sydney
0 1 0 9
asked 07 September, 2021
61 votes
5 answers
1.9K views
How can I get the sha1 hash of a string in node.js?

I'm trying to create a websocket server written in node.js To get the server to work I need to get the S

avatar
Luis
0 1 0 9
asked 07 September, 2021
61 votes
6 answers
2.3K views
Closing WebSocket correctly (HTML5, Javascript)

I am playing around with HTML5 WebSockets. I was wondering, how do I close the connection gracefully? Like, wh

avatar
Frederick
0 1 0 9
asked 07 September, 2021
67 votes
4 answers
1.3K views
My Understanding of HTTP Polling, Long Polling, HTTP Streaming and WebSockets

I have read many posts on SO and the web regarding the keywords in my question title and learned a lot from th

avatar
Stacia
0 1 0 9
asked 07 September, 2021
67 votes
3 answers
1K views
Sending websocket ping/pong frame from browser

I keep reading about ping/pong messages in websockets to keep the connection alive, but I'm not sure what

avatar
Stacia
0 1 0 9
asked 07 September, 2021
63 votes
12 answers
1.4K views
Send message to specific client with socket.io and node.js

I'm working with socket.io and node.js and until now it seems pretty good, but I don't know how to s

avatar
Frederick
0 1 0 9
asked 07 September, 2021
56 votes
12 answers
1.7K views
HTTP headers in Websockets client API

Looks like it's easy to add custom HTTP headers to your websocket client with any HTTP header client whic

avatar
Daniel
0 1 0 9
asked 07 September, 2021
62 votes
4 answers
2.4K views
In what situations would AJAX long/short polling be preferred over HTML5 WebSockets?

I am building a small chat application for friends, but unsure about how to get information in a timely manner

avatar
Georgie
0 1 0 9
asked 07 September, 2021
55 votes
21 answers
414 views
React Js conditionally applying class attributes

I want to conditionally show and hide this button group depending on what is passed in from the parent compone

avatar
Chelsea
0 1 0 9
asked 07 September, 2021
55 votes
13 answers
1.2K views
Invariant Violation: _registerComponent(...): Target container is not a DOM element

I get this error after a making trivial React example page: Uncaught Error: Invariant Violation: _register

avatar
Luis
0 1 0 9
asked 07 September, 2021
61 votes
16 answers
1.2K views
Setting a backgroundImage With React Inline Styles

I'm trying to access a static image to use within an inline backgroundImage property within React. Unfort

avatar
Kurtis
0 1 0 9
asked 07 September, 2021
52 votes
21 answers
3.1K views
Rerender view on browser resize with React

How can I get React to re-render the view when the browser window is resized? Background I have some blocks

avatar
Dusty
0 1 0 9
asked 07 September, 2021
58 votes
20 answers
858 views
React "after render" code?

I have an app where I need to set the height of an element (lets say "app-content") dynamically. It takes the

avatar
Jefferey
0 1 0 9
asked 07 September, 2021
56 votes
15 answers
1.7K views
useState set method not reflecting change immediately

I am trying to learn hooks and the useState method has made me confused. I am assigning an initial value to a

avatar
Deedee
0 1 0 9
asked 07 September, 2021
66 votes
13 answers
2.4K views
Error Running React Native App From Terminal (iOS)

I am following the tutorial on the official React Native website. Using the following to build my project: r

avatar
Corey
0 1 0 9
asked 07 September, 2021
47 votes
30 answers
2.7K views
Invariant Violation: Objects are not valid as a React child

In my component's render function I have: render() { const items = ['EN', 'IT',

avatar
Suzan
0 1 0 9
asked 07 September, 2021
67 votes
16 answers
1.2K views
React - changing an uncontrolled input

I have a simple react component with the form which I believe to have one controlled input: import React from

avatar
Kurtis
0 1 0 9
asked 07 September, 2021