server

Unable to persist a sockets array upon user connection

两盒软妹~` 提交于 2019-12-08 10:02:56
问题 I have these two files: io.js: var io = require('socket.io')(); var socketioJwt = require('socketio-jwt'); var jwtSecret = require('./settings').jwtSecret; io.set('authorization', socketioJwt.authorize({ secret: jwtSecret, handshake: true })); io.on('connection', function(socket) { IO.pushSocket(socket); }); var IO = module.exports = { io: io, sockets: [], pushSocket: function(socket) { if (typeof IO.sockets === 'undefined') { IO.sockets = []; } IO.sockets.push(socket); console.log(IO.sockets

Send params in header and get them in server side - java

▼魔方 西西 提交于 2019-12-08 09:50:18
问题 I'm using Jersey and I want to get params from the header of request; Here is my java server side code: @GET @Path("/usersForMobile") @Produces({ MediaType.APPLICATION_JSON + ";charset=utf-8" }) public Response getUsersForMobile(@Context UriInfo info) { String rashutId ; String userName ; String password; List<User> inspectorList= new ArrayList<User>(); try { rashutId = info.getQueryParameters().getFirst("rashutId"); userName = info.getQueryParameters().getFirst("userName"); password = info

Server side not reading message correctly

廉价感情. 提交于 2019-12-08 09:39:36
问题 I'm developing a client-server application, where the client is in Android and the server in C#. Before using C# for the server I used autoIT and it worked fine aside from the fact that I had to send messages of 9 characters or else it would get weird symbols. Now in C# I'm having the same problem. I tried removing all white space but it always leaves something at the start of the message. Single word messages like: "SendClose" the server reads as " SendClose" or " SendClose" if i remove the

AssetBundle (DLC) data load to Android phone at runtime [UNITY] [duplicate]

独自空忆成欢 提交于 2019-12-08 09:18:18
问题 This question already has an answer here : Download AssetBundle in hard disk (1 answer) Closed last year . I'm using Asset Browser of Unity. I want to reduce my game. So I should make Asset Bundle(DLC) and when i click download button in phone, datas will download and load to phone as permanantly, it will download at once, after that user can play as offline. I builded my data in Asset Browser. how can i load it? 回答1: First, you need to build the asset bundles (with Asset bundle browser) and

How to handle message that failed to response success, but success commit to database

荒凉一梦 提交于 2019-12-08 08:41:17
问题 I have some question about handling message that failed to response success, but success commit to database. The design that I think is for guarantee processing message once. Following sequences are step for handling. Question is included on statements with ★ 1) Fetch message from Message Queue -> When failed after this, MQ will timeout & retry 2) Cache.SetIfNotExist(MessageId, MyId, Timeout) ProcessingTime < Cache.Timeout < MQ.Timeout * This make ownership for message -> When failed after

How to make request from server to devices behind router

不羁的心 提交于 2019-12-08 08:24:32
问题 I need to make requests from the server to application running on hardware at the users home. I can't let the application push the data to the server since i don't store the data, but need to forward it to a client-facing web app (Also i am not allowed to store the data on the server). I am currently unsure how to achieve this. My only idea is to have idle socket connections open where i can write the requests into. This seems complicated and i don't know whether it is scalable (is there a

docker nginx 502 bad gateway

流过昼夜 提交于 2019-12-08 08:21:49
问题 I was trying to change the port number in both nginx.conf and docker-compose.yml to 9001 instead 9000. However, when I run docker-compose up, it shows 502 Bad Gateway. Why is that? am I locked to use port 9000 only? nginx.conf location /index.php { include fastcgi_params; fastcgi_connect_timeout 10s; fastcgi_read_timeout 10s; fastcgi_buffers 256 4k; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_pass php:9000; <-- Changing this to 9001 } docker-compose.yml php:

Java: Using server to create P2P between two clients

Deadly 提交于 2019-12-08 06:29:53
问题 I am experimenting with a file transfer program in Java and I wanted to create a server that would handle creating P2P connection between two clients. Don't know how that should work, exchanging sockets? I don't want to exchange IP address... Seen some questions similar (ev. Connecting two clients via server java) but I have no idea how to achieve that. Thanks for your time 回答1: It sounds like you are looking for nat traversal techniques. There is no single solution because there are many

Sending data from javascript/html page to Express NodeJS server

霸气de小男生 提交于 2019-12-08 04:26:34
问题 I'm working on a cordova application, using html5 and javascript. The architecture is the following one : the phone application requests something to the server, which asks a firebird database. The database answers to the server which gives the asked data to the phone application (in html5 / javascript). I've been able to send the data from the server to the phone with JSON, and I thought it would be the same to send some data from the phone app to the server. However, I have no idea how to

Tomcat 8 running but refused to connect

主宰稳场 提交于 2019-12-08 04:10:48
问题 I am currently running an instance of Tomcat8 on a ubuntu server that I installed using apt-get install tomcat8 . I hosted an application and it was running fine without a SSL certificate. Recently I bought a SSL certificate from sslcertificate.com and followed https://support.comodo.com/index.php?/Knowledgebase/Article/View/638/0/certificate-installation-java-based-web-servers-tomcat-using-keytool to install it. I was able to package it together and configure the server.xml file. Here is