Socket.IO

I'm receiving duplicate messages in my clustered node.js/socket.io/redis pub/sub application

匆匆过客 提交于 2020-01-30 23:36:27
问题 I'm using Node.js, Socket.io with Redisstore, Cluster from the Socket.io guys, and Redis. I've have a pub/sub application that works well on just one Node.js node. But, when it comes under heavy load is maxes out just one core of the server since Node.js isn't written for multi-core machines. As you can see below, I'm now using the Cluster module from Learnboost, the same people who make Socket.io. But, when I fire up 4 worker processes, each browser client that comes in and subscribes gets 4

Angular 4 - ERROR TypeError: Cannot read property 'push' of undefined

霸气de小男生 提交于 2020-01-30 10:57:47
问题 this is my component code. and i am using socket.on to get data from node server and then want to push that into a Typescript array. its showing error on push function. actually list array is undefined at this point. import { Component } from '@angular/core'; import * as io from 'socket.io-client'; @Component({ selector: 'app-admin', templateUrl: './admin.component.html', styleUrls: ['./admin.component.css'] }) export class AdminComponent{ private socket: io.Socket; private list: any[];

Communicating between Node.Js and ASP.NET MVC Application

限于喜欢 提交于 2020-01-29 12:52:35
问题 I have an existing complex website built using ASP.NET MVC, including a database backend, data layer, as well as the Web UI layer. Rebuilding this website in another language is not a feasible option. There are some UI elements on some views (client side) which would benefit from live interactivity, involving both push and pull, so rather than implement some kind of custom long polling or websocket server in asp.net, I am looking to leverage node.js for Windows, and Socket.io. My problem is

Communicating between Node.Js and ASP.NET MVC Application

馋奶兔 提交于 2020-01-29 12:51:11
问题 I have an existing complex website built using ASP.NET MVC, including a database backend, data layer, as well as the Web UI layer. Rebuilding this website in another language is not a feasible option. There are some UI elements on some views (client side) which would benefit from live interactivity, involving both push and pull, so rather than implement some kind of custom long polling or websocket server in asp.net, I am looking to leverage node.js for Windows, and Socket.io. My problem is

Communicating between Node.Js and ASP.NET MVC Application

不想你离开。 提交于 2020-01-29 12:49:05
问题 I have an existing complex website built using ASP.NET MVC, including a database backend, data layer, as well as the Web UI layer. Rebuilding this website in another language is not a feasible option. There are some UI elements on some views (client side) which would benefit from live interactivity, involving both push and pull, so rather than implement some kind of custom long polling or websocket server in asp.net, I am looking to leverage node.js for Windows, and Socket.io. My problem is

socket.io hardcoded vs dynamic connection url

我怕爱的太早我们不能终老 提交于 2020-01-29 09:34:51
问题 Why most tutorials, examples and questions here use the local IP or localhost (or any other hard-coded path) like this: var socket = io.connect('http://127.0.0.1:3700'); Instead of simply: var socket = io.connect(document.location.protocol+'//'+document.location.host); Or even: var socket = io.connect(); Are there any risks making it dynamic like this? Are there any better way to make my script work locally and in production without having to change this value every time? 回答1: I don't see any

socket.io hardcoded vs dynamic connection url

你离开我真会死。 提交于 2020-01-29 09:34:25
问题 Why most tutorials, examples and questions here use the local IP or localhost (or any other hard-coded path) like this: var socket = io.connect('http://127.0.0.1:3700'); Instead of simply: var socket = io.connect(document.location.protocol+'//'+document.location.host); Or even: var socket = io.connect(); Are there any risks making it dynamic like this? Are there any better way to make my script work locally and in production without having to change this value every time? 回答1: I don't see any

How to resolve this .map error in Socket programming angular?

北城余情 提交于 2020-01-26 04:41:05
问题 I am starting with socket programming in Angular from the link: https://www.npmjs.com/package/ngx-socket-io and I am getting error. Need help. Error on hover: Property 'map' does not exist on type 'Observable' 来源: https://stackoverflow.com/questions/59872472/how-to-resolve-this-map-error-in-socket-programming-angular

multiple child_process with node.js / socket.io

偶尔善良 提交于 2020-01-25 20:34:13
问题 This is more of a design question rather than implementation but I am kind of wondering if I can design something like this. I have an interactive app (similar to python shell). I want to host a server (lets say using either node.js http server or socket.io since I am not sure which one would be better) which would spawn a new child_process for every client that connects to it and maintains a different context for that particular client. I am a complete noob in terms of node.js or socket.io.

Using socket.io with express 4 generator

帅比萌擦擦* 提交于 2020-01-25 20:27:27
问题 New to node, so my apologies. I'm working on my app and I want to send the location using socket.io. I've found 1000 examples, but all refer to when express had no routes, and it all was at the app.js. All examples refer to chat applications. I was able to run an example piecing together several questions I searched but, I don't understand how to get the io that I finally got working on my app.js to interact with my index.js so I can use it with multiple emit parameters. express.io is