client-server

sending serialization file via sockets in java

别来无恙 提交于 2020-01-05 08:15:07
问题 System.out.println("Java is awesome!"); Pardon my enthusiasm; I just can't believe how powerful Java is, what with its ability to not only save objects (and load them), but also with its main purpose, to send them over a network. This is exactly what I must do, for I am conducting a beta-test. In this beta-test, I have given the testers a version of the game that saves the data as Objects in a location most people don't know about (we are the enlightened ones hahaha). This would work fine and

sending serialization file via sockets in java

核能气质少年 提交于 2020-01-05 08:14:23
问题 System.out.println("Java is awesome!"); Pardon my enthusiasm; I just can't believe how powerful Java is, what with its ability to not only save objects (and load them), but also with its main purpose, to send them over a network. This is exactly what I must do, for I am conducting a beta-test. In this beta-test, I have given the testers a version of the game that saves the data as Objects in a location most people don't know about (we are the enlightened ones hahaha). This would work fine and

Send object via socket

混江龙づ霸主 提交于 2020-01-05 08:06:55
问题 I want to send x object over socket but when I run this code i got nothings. it is stop at new ObjectInputStream(socket.getInputStream()) and don't do any thing else. Server class: public class Server { private static final int PORT = 9001; ServerSocket listener; private Handler h[] = new Handler[5]; private int clientCount = 0; public Server() throws Exception{ System.out.println("The server is running."); listener = new ServerSocket(PORT); run(); } public void run(){ while (true) { try {

Send object via socket

隐身守侯 提交于 2020-01-05 08:06:19
问题 I want to send x object over socket but when I run this code i got nothings. it is stop at new ObjectInputStream(socket.getInputStream()) and don't do any thing else. Server class: public class Server { private static final int PORT = 9001; ServerSocket listener; private Handler h[] = new Handler[5]; private int clientCount = 0; public Server() throws Exception{ System.out.println("The server is running."); listener = new ServerSocket(PORT); run(); } public void run(){ while (true) { try {

What does it mean that accept() creates a new socket?

风流意气都作罢 提交于 2020-01-05 06:37:28
问题 My question is based on the following understanding Socket is defined by ip:port. Both server and client will have their own socket Socket connection is defined by five touples server_ip, server_port, client_ip, client_port, protocol A socket descriptor is an integer value that identifies a socket I tried to implement my own server where socket() and accept() returns different socket descriptor value (Is it always the case?). My question is why is it said that accept() creates a new socket if

Suggestion for getting data from a web server?

倖福魔咒の 提交于 2020-01-05 05:30:08
问题 I have a web server which contains a list of "interesting locations". These are "hard coded" on the web server, and maintained from an administrator on the server-side. Users can't add or remove anything. From within my app, I want to make a button "fetch locations", and the app should then contact the web server and ask for that "interesting locations" list. I'm using Core Data and have an InterestingLocation entity in my model. The goal is to get the data from the web server and persist it

Is RESTlet suitable for this job?

强颜欢笑 提交于 2020-01-04 15:28:12
问题 (sorry for reposting this question, for some reason I can't log in to the other account) Is RESTlet the best choice for performing the following server/client architecture? 1- we have a server containing a database and an ftp server (within a network of 20 clients) 2- the various users on the network can create user accounts (there exists different access permissions) 3- users should be able to: (a) retrieve data from the database or files from the ftp server (b) store data in the database or

Windows/Linux issue with Client/Server Socket with Applet

只愿长相守 提交于 2020-01-04 13:26:22
问题 I'm new at socket programming and threads. I'd be happy if anyone can help me out. I currently working on a multi-client server problem where each new client connection gets its own thread and its an applet. here is a code snippet of when to close the thread of a client when it disconnects. String inputMessage; //message stored here BufferedReader in = new BufferedReader( new InputStreamReader(socket.getInputStream())); while((inputMessage = in.readLine()) != null){ //Update message buffer

Windows/Linux issue with Client/Server Socket with Applet

旧城冷巷雨未停 提交于 2020-01-04 13:26:12
问题 I'm new at socket programming and threads. I'd be happy if anyone can help me out. I currently working on a multi-client server problem where each new client connection gets its own thread and its an applet. here is a code snippet of when to close the thread of a client when it disconnects. String inputMessage; //message stored here BufferedReader in = new BufferedReader( new InputStreamReader(socket.getInputStream())); while((inputMessage = in.readLine()) != null){ //Update message buffer

How to check if TCP socket is connected in android app

岁酱吖の 提交于 2020-01-04 04:21:14
问题 I'm writing a short test app to practice connecting to a server. All the app does is take an IP from an editText box, and then connect to the server. It looks like I can connect to the server because I am able to send data to the server and have the server print it. I wanted to add some error checking to confirm that I am connected before attempting to send anything to the server. However, the problem is, whenever I use the Socket.isConnected() or isBound() methods my app crashes. So how do I