websocket

WebSocket disconnect received unexpectedly by using Django Channels

╄→尐↘猪︶ㄣ 提交于 2020-12-13 07:16:55
问题 Using Django channels to update the user on the current status of a potentially long running task, I'm facing a WebSocket DISCONNECT that I would like to trace down. The setup looks pretty straight forward. settings.py defines the channel layer: ASGI_APPLICATION = "config.routing.application" CHANNEL_LAYERS = { 'default': { 'BACKEND': 'channels_redis.core.RedisChannelLayer', 'CONFIG': { "hosts": [('127.0.0.1', 6379)], }, }, } In routing.py we basically follow the default suggestion from the

WebSocket disconnect received unexpectedly by using Django Channels

跟風遠走 提交于 2020-12-13 07:15:59
问题 Using Django channels to update the user on the current status of a potentially long running task, I'm facing a WebSocket DISCONNECT that I would like to trace down. The setup looks pretty straight forward. settings.py defines the channel layer: ASGI_APPLICATION = "config.routing.application" CHANNEL_LAYERS = { 'default': { 'BACKEND': 'channels_redis.core.RedisChannelLayer', 'CONFIG': { "hosts": [('127.0.0.1', 6379)], }, }, } In routing.py we basically follow the default suggestion from the

Express node js webssockets is recieving messages from websocket server but not being able to send them

故事扮演 提交于 2020-12-13 05:41:14
问题 I have websockets setup with aws api gateway, I also have an ec2 instance running with node and express and ws websockets, I am able to send a message with wscat to the apigateway wss url and it shows up in the ec2 instance, but if I send a message from the ec2 instance it doesnt show up back in the wscat. I followed this tut to setup the apigateway https://aws.amazon.com/blogs/compute/announcing-websocket-apis-in-amazon-api-gateway/ Here is the ec2 instance code. I am not quite sure what

Express node js webssockets is recieving messages from websocket server but not being able to send them

社会主义新天地 提交于 2020-12-13 05:40:36
问题 I have websockets setup with aws api gateway, I also have an ec2 instance running with node and express and ws websockets, I am able to send a message with wscat to the apigateway wss url and it shows up in the ec2 instance, but if I send a message from the ec2 instance it doesnt show up back in the wscat. I followed this tut to setup the apigateway https://aws.amazon.com/blogs/compute/announcing-websocket-apis-in-amazon-api-gateway/ Here is the ec2 instance code. I am not quite sure what

cannot connect to socket.io server in client side using ngrok

别来无恙 提交于 2020-12-13 04:55:05
问题 I'm trying to connect to the socket server in react-native, I'm using ngrok and it's the log when the mobile app running HTTP Requests ------------- POST /io/webrtc/ 400 Bad Request GET /io/webrtc/ 200 OK { "code": 2, "message": "Bad handshake method" } although the Web app , it works very well! Code snippet Server.js const express = require('express'); let io = require('socket.io')({ path: '/io/webrtc', }); const app = express(); const port = 8080; //https://expressjs.com/en/guide/writing

cannot connect to socket.io server in client side using ngrok

纵然是瞬间 提交于 2020-12-13 04:54:10
问题 I'm trying to connect to the socket server in react-native, I'm using ngrok and it's the log when the mobile app running HTTP Requests ------------- POST /io/webrtc/ 400 Bad Request GET /io/webrtc/ 200 OK { "code": 2, "message": "Bad handshake method" } although the Web app , it works very well! Code snippet Server.js const express = require('express'); let io = require('socket.io')({ path: '/io/webrtc', }); const app = express(); const port = 8080; //https://expressjs.com/en/guide/writing

Sending files over TCP using C++, recving wrong size

假装没事ソ 提交于 2020-12-13 03:30:28
问题 I am very new to socket programming, and i am trying to send over TCP connection but getting few errors. here is my code FILE* File; char* Buffer; unsigned long Size; File = fopen("C:\\test.zip", "rb"); if (!File) { printf("Error while readaing the file\n"); return; } // file size 1 fseek(File, 0, SEEK_END); Size = ftell(File); fseek(File, 0, SEEK_SET); Buffer = new char[Size]; fread(Buffer, Size, 1, File); char cSize[MAX_PATH]; sprintf(cSize, "%i", Size); cout << "MAX PATH " << MAX_PATH<

Caused by: java.net.SocketException: Connection reset in Rest call

和自甴很熟 提交于 2020-12-12 17:41:47
问题 I am calling REST service and one of the APIs fail intermittently, I had looked for the answer, but did not find anything significant. Below is the stacktrace. org.springframework.web.client.ResourceAccessException: I/O error on POST request for "https://api.blahblah.com/v2/authentication": Connection reset; nested exception is java.net.SocketException: Connection reset at org.springframework.web.client.RestTemplate.doExecute(RestTemplate.java:744) at org.springframework.web.client

how to Get all connected clients in socket.io

大憨熊 提交于 2020-12-12 05:41:46
问题 I have socket.io v2.3 and I'm trying to get all connected sockets from a different file. Here's my setup: const io = require('socket.io'); let IO; let myNameIO; module.exports = { create: (server) => { IO = io(server, { cors: { origin: '*' } }); const redisConnection = redisAdapter({ host: redisHost, port: redisPort }); IO.adapter(redisConnection); IO.on('connection', (socket) => { console.log('a user connected'); }); IO.on('disconnect', (socket) => { console.log('disconnected'); }); myNameIO