0

my connection to WebSocket is getting Disconnected continuously. I'm working in folder realtime on localhost.
How to keep WebSocket connection live?

How to use WebSocket in javascript?

Link: http://localhost/realtime/

<script language="javascript" type="text/javascript">  

    var myWebSocket = new WebSocket("ws://localhost/realtime");

    myWebSocket.onopen = function(evt) { alert("Connection open ..."); }; 

    myWebSocket.onmessage = function(evt) { alert( "Received Message: " + evt.data); };

    myWebSocket.onclose = function(evt) { alert("Connection closed."); }; //This line is always true

</script>

How to insert data to 'generalposts' table id, post field using socket?

How to fetch data using socket from above table & fields?

I used this too var myWebSocket = new WebSocket("ws://localhost:8005/realtime"); and var myWebSocket = new WebSocket("ws://localhost:9998/realtime");

(Ref:http://www.tutorialspoint.com/html5/html5_websocket.htm)

2
Contributors
2
Replies
18
Views
2 Years
Discussion Span
Last Post by phoenix254
0

Any body please help me....!!!!!!!!

I've made list. How to implement following?

//create a new WebSocket object.
websocket = new WebSocket("ws://localhost:9000/realtime/demo.php");
websocket.onopen = function(evt) { /* do stuff / }; //on open event
websocket.onclose = function(evt) { /
do stuff / }; //on close event
websocket.onmessage = function(evt) { /
do stuff / }; //on message event
websocket.onerror = function(evt) { /
do stuff */ }; //on error event
websocket.send(message); //send method
websocket.close(); //close method

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.