client-server

Multithreaded Server using TCP in Java

為{幸葍}努か 提交于 2019-12-25 05:08:17
问题 I'm trying to implement a simple TCP connection between Client/Server. I made the Server multithreaded so that it can take either multiple requests (such as finding the sum, max, min of a string of numbers provided by the user) from a single client or accept multiple connections from different clients. I'm running both of them on my machine, but the server doesn't seem to push out an answer. Not sure what I'm doing wrong here -- public final class CalClient { static final int PORT_NUMBER =

Sharing resources between Java projects in Eclipse

女生的网名这么多〃 提交于 2019-12-25 04:53:43
问题 I am making a game using a client-server model. Currently I have 3 projects: client, server, and common. Currently all of the resources for the game are in a folder inside the common project, which is recognised as a source folder by Eclipse. This allows me to access the resources from within the client and server projects using: InputStream in = SomeClass.class.getClassLoader().getResourceAsStream(filename); The problem is that this method only works for reading the files, but I want to be

Android | can't Send/Receive message to/from Wialon Server using Socket

*爱你&永不变心* 提交于 2019-12-25 04:42:49
问题 First of all I know that this is a REALLY COMMON problem and I have surfed all over dozens of publications and posts. They have mostly the same solution. But after hours of trying that still doesn't work for me. The problem is in sending/receiving text messages - I don't receive any response from server. Its not a HTTP server so I use Socket. I suppose there're could several causes: Problems with connection initialization; Possibly process of sending/receiving messages is wrong; Perhabs I'm

Best Java supported server/client protocol?

房东的猫 提交于 2019-12-25 04:39:33
问题 I'm in the process of writing a client/server application which should work message based. I would like re-use as much as possible instead of writing another implementation and curious what others are using. Features the library should offer: client and server side functionality should work message based support multi-threading should work behind load balancer / firewalls I did several tests with HTTPCore, but the bottom line is that one has to implement both client and server, only the

Basic echo server, client-server relationship

岁酱吖の 提交于 2019-12-25 03:05:12
问题 So as my project I had to write a client class and a simple server class that will ECHO message written by the client. For some reason I either get I/O exception or a loop of exceptions that socket's closed. I would really appreciate some help, because I struggle with this program for 2 days straight and cannot find any solutions. My Server class: import java.io.*; import java.net.*; import java.util.regex.Pattern; public class SimpleServer { private ServerSocket ss = null; private

Connect my exist server to GCM

淺唱寂寞╮ 提交于 2019-12-25 02:29:46
问题 I developed a client on android app and a server, but now I discovered the GMC- "Google Cloud Messaging for Android" Is there any way to connect the GCM to my server, without changing everything? The client send data to the server with socket, and what I need is that the server will send the data to the GCM, and the GCM will send the data to all the clients. I don't need the clients to send data to the GCM, all what I need is : client -(socket)--> server ---> GCM ---> clients Someone have any

Copying a File from Client to Server

我的梦境 提交于 2019-12-25 02:05:35
问题 I'm trying to copy a file from Client to Server, in Java, like so: Client: public class Client { public static void main(String[] args) throws Exception { String fileName = "D:\\6282.mp3"; try { } catch (Exception e) { Scanner scanner = new Scanner(System.in); String file_name = fileName; File file = new File(file_name); Socket socket = new Socket("localhost", 3332); ObjectInputStream ois = new ObjectInputStream(socket.getInputStream()); ObjectOutputStream oos = new ObjectOutputStream(socket

Java Socket read and write unexpected behavior

早过忘川 提交于 2019-12-25 01:49:45
问题 I faced an issue while transferring file from client to server. So I did a simple client and server code in java using sockets. I found some unexpected behavior. I can't find why it happens so. Following is the code Server side code: import java.io.*; import java.net.*; class Server { public static void main(String args[]) { ServerSocket ser; try { ser=new ServerSocket(9000); Socket cnfcon=ser.accept(); OutputStream outstr=cnfcon.getOutputStream(); InputStream inpstr=cnfcon.getInputStream();

Push notification on BlackBerry

安稳与你 提交于 2019-12-25 01:45:01
问题 I need to send a notification to the BlackBerry device when new information is added to the server. The server should send the notification to the BlackBerry device and blackberry device should then receive this notification. I installed the BlackBerry push SDK, and I obtain registration with the BlackBerry Push Service, but I didn't understand how to use it and when. What is the next step? What should I do for the client and server part? 回答1: Blackberry provide the sample demo " HttpPushDemo

Login/Register by using RESTFul api written on Java

对着背影说爱祢 提交于 2019-12-25 01:44:14
问题 I have created Java Web Application by using Netbeans IDE. I have created entities with relationships. Webpages are simple dashboards where I can add new entities, change them and delete them. I have added Restful web services to my entities. So web page will be available only for admin and I want to create client application that will have access only for his own data. That means client must login or register to my server. When user logins/registers on website, server will create session for