Socket.IO

Successive markers with navigator.geolocation.watchPosition

你。 提交于 2019-12-25 02:46:40
问题 I use Leaflet and OpenStreetMap. In addition, I send geolocation data with socket.io in nodejs. The position of the user is displayed successfully with the code: navigator.geolocation.getCurrentPosition(.........) Now I want the position of the user is updated on the map every X seconds. So I replaced the code: navigator.geolocation.watchPosition(.........) My problem is that a new marker is added geolocation every X seconds, and the oldest markers are not removed. Could someone help me

Socket.io Java Client with support for 1.0.x

筅森魡賤 提交于 2019-12-25 02:46:27
问题 I am writing an Android app that connects to a server using socket.io (v1.0.4). Is there a socket.io Java client out there that works with socket.io v1.0? I was originally using the Gottox solution but it only seems to work with socket.io <= v0.92. Some other libraries available https://github.com/koush/AndroidAsync https://github.com/nkzawa/socket.io-client.java nkzawa's claims to be supported for 1.0 but there seem to be some issues with it. 回答1: I got nkzawa's solution working on my server

send data from C# form to node server socket.io

强颜欢笑 提交于 2019-12-25 02:26:56
问题 I am trying to send data from a C# form which I have stored in a variable called ClientMsg . I am using SocketIoClientDotNet to communicate to the node server. I have the connection setup which is all fine but I am unable to send data from the form to my server. Could someone tell me how to do this as I cant find anything online? Code Code Node Update (added code): private void socketManager() { var server = IO.Socket("http://localhost"); server.On(Socket.EVENT_CONNECT, () => { UpdateStatus(

Including socket.io.js results in undefined 'require'

人盡茶涼 提交于 2019-12-25 02:22:02
问题 I've just started with node.js and socket.io. I installed node.js using the windows installer, resulting in the following install path: C:\Program Files (x86)\nodejs I used npm to install socket.io and managed to include this in my server file, which is located in my projects folder, under D:\projects\node\nodeserv.js I then included the socket.io.js, which is located under the same socket.io folder, under the nodjs folder. However, when I try to open the HTML file containing the client code,

Error connecting an Android Client to a socket server in NodeJS

假如想象 提交于 2019-12-25 02:07:18
问题 I got a Socket Server running in NodeJS. I've connected from a Console Application with this library: https://github.com/Gottox/socket.io-java-client I used the example app (from the link) and it works correctly. Then, I translate that code to an Android application, but it doesn't connect to the Server. I put the Network Permissions of the app inside the "androidmanifest" file, but it didn't work either. Bellow is the error when I run the app. Thanks in advance for the help... 02-04 00:56:51

Connecting to GDAX websocket api using socket.io with webpack

让人想犯罪 __ 提交于 2019-12-25 02:00:57
问题 I want to connect to the GDAX websocket api with an in browser application built with react and webpack. I cannot use the offiicial gdax-node or gdax-toolkit api's because they are not compatible with webpack. I decided to try connecting to the websocket myself using socket.io, but the code below never establishes a connection. In the code below my "subscribing" log message after connect never appears. How do I get this code to connect or at least show an error message? const io = require(

Release event handlers on disconnection of Socket.IO client

被刻印的时光 ゝ 提交于 2019-12-25 01:52:51
问题 I'm using Socket.IO like in this sample: io.sockets.on("connection", function (socket) { myService.on("myevent", function() { socket.emit("myevent", { /* ... */ }); // some stuff happens here of course }); }); myService is a singleton and a subclass of EventEmitter which triggers the myevent over the time. Anything works fine, however I guess that I create some kind of leak in this case. How does my service know that it doesn't need to call the handler once the connection is destroyed? Is

EmberJS global websocket connection

ⅰ亾dé卋堺 提交于 2019-12-25 01:45:57
问题 Im using EmberJS and im trying to get data from the backend using websocket (socket.io) so i've set this Application Route App.ApplicationRoute = Ember.Route.extend( setupController: (controller, data) -> store = @get 'store' socket = io.connect "http://localhost:4000/orders" ## Line 4 socket.on "new_order", (order) -> store.load(App.Order, order) socket.on "new_billing", (bill) -> store.load(App.Bill, bill) socket.on "connected", -> console.log "Ready" model: -> return { title: "Ordenes" }

Is there any disadvantage in enforcing a Single Web Socket Connection per User?

杀马特。学长 韩版系。学妹 提交于 2019-12-25 01:18:53
问题 I came across this article. It talks about Enforcing a Single Web Socket Connection per User It states that some of the advantages are that it makes the server side logic less complex among others. My questions are Are there any disadvantages of doing the same? Is it a common/good practice to do so when creating real-time applications using websockets? -----------EDIT------------- After doing some research I have learnt that you can share express sessions with socket.io. Which brings me to

How use socket.io in express routes with node.js

ε祈祈猫儿з 提交于 2019-12-25 01:18:35
问题 I'm using Express with Socket.io in the server side but i can't use out of app.js, i need how to use SocKet.io in Express routes. app.js ... let http = require('http').Server(app); let io = require('socket.io')(http); io.on('connection', (socket) => { console.log('user connected'); socket.on('disconnect', function(){ console.log('user disconnected'); }); socket.on('message', (message) => { console.log("Message Received: " + message); io.emit('message', {type:'new-message', text: message}); })