client-server

java chat sending users list from server to clients and update it

旧街凉风 提交于 2019-12-13 05:15:55
问题 I write client-server chat using sockets. Help me please understand how send the list of current registered users from server to clients and update it when list changed. I read this similar post but steel don't understand how to do it. I used BufferedReader and PrintWriter streams for sending and receiving messages. And I don't want sending the list of the users any time when clients send messages. I keep list of users in a map as a key set on the server side. public class Server{ private

How exactly servlet Work in GWT?

杀马特。学长 韩版系。学妹 提交于 2019-12-13 04:58:45
问题 I am try to find out How servlet work. I used this code to design my servlet client! formPanel.setAction(GWT.getModuleBaseURL()+"fileupload"); and on click formPanel.Sumit(); server! in Server, i didnt Understand how this doPost method will be called by the client. When i click o submit button , i can "you selected test.doc" in development mode. Please someone help. Source Code. Client. final FormPanel formPanel = new FormPanel(); formPanel.addFormHandler(new FormHandler() { public void

Send multiple data type over socket

这一生的挚爱 提交于 2019-12-13 04:24:15
问题 I want to send multiple data type over socket. I have that code: when I create client, it generates public and private keys and sends the public to serve and the serve stores it. when client wants to send message to another client, it gets his public key from the server to encrypt the message. But when I run this code it freeze at client in dest_public_key=(PublicKey) oin.readObject() Why it stop at here? Why it doesn't read the PublicKey's object that the handler writes to it? Is there any

make a Client-Server application

杀马特。学长 韩版系。学妹 提交于 2019-12-13 04:19:10
问题 I used to create web app in the same computer, but if the server and the client is not in the same computer, how can we access to the web page ? I mean, for example I have an html form and a button "ok" : If the server and the client are in the same computer, in action = " " we put localhost/file.py , but if the server and the client are not in the same computer how to do this ? Because the client can't to have localhost in his webbrower (url). 回答1: Your script is supposed to be run as a CGI

Adding authorization header interface android retrofit

烈酒焚心 提交于 2019-12-13 04:01:23
问题 I'm using retrofit library for solving my tasks connected with requests to server. I have got parameters from server developers: URL https://server/v1/message/list Edit this section Method GET Edit this section HTTP Headers Authorization:Bearer $access_token Edit this section URL Params type 0 - for received messages 1 - for sent messages Optional: offset In normal case you should not pass this parameter manually. It uses in previous/next urls, nevertheless it can takes values > 1 for getting

Connecting to SQL database directly or through a client-server service

戏子无情 提交于 2019-12-13 03:36:28
问题 Hi i'm currently creating a game using c# xna and will be allowing users to have some sort of profile system. So they can create account, sign-in view profile, achievements etc. While I am testing this I am using a local instance of SQL Server Express. In testing this is fine, however when creating the finished product is it ok to simply change the connection strings to connect to a remote publicly accessible SQL server or would this have security implications. Could someone for example be

Client-Server 2 way communication unsuccessful (Perl)

别来无恙 提交于 2019-12-13 03:35:51
问题 REQ FLOW : ____________ LOGIN ___________ | |------------------->>| | | CLIENT | LOGIN ACK | SERVER | |__________|<<------------------ |__________| The client and the server sends across the contents of the files they open. CODE: SERVER $socket = new IO::Socket::INET ( LocalHost => '127.0.0.1', LocalPort => '0155', Proto => 'tcp', Listen => 1, Reuse => 1 ) or die "Oops: $! \n"; print "Waiting for the Client.\n"; while($clientsocket = $socket->accept()){ print "Connected from : ",

Cannot read response from Java socket server using PHP client

自古美人都是妖i 提交于 2019-12-13 03:34:44
问题 I have a server written in Java. Its a simple one that echoes "HELLO" when a client connects and then echoes back any reply the client sends. The code is below: ServerSocket ss=new ServerSocket(2001); while(true) { Socket s=ss.accept(); BufferedReader in=new BufferedReader(new InputStreamReader(s.getInputStream())); PrintWriter out=new PrintWriter(s.getOutputStream(),true); out.println("HELLO"); String msg=in.readLine(); out.println(msg); } I have a PHP script that connects to the server: <

How Polling mechanism can be realized with RMI?

冷暖自知 提交于 2019-12-13 02:55:00
问题 Following the design/architecture i created for multiuser/network turn-based game with RMI server callbacks, I have tried to create a distributed animation in which my model(Ball) is remote object and it updates the clients via callback mechanism from server. The current situation of code is : The model remote object, which is iterating client list and calling update method of them, public class BallImpl extends UnicastRemoteObject implements Ball,Runnable { private List<ICallback> clients =

A simple java client server program

百般思念 提交于 2019-12-13 02:23:34
问题 So I did this client server program in java for my college mini project. Note that this is just a small module of a big project I'm working on. I need a string to be sent from the client to the server. The server will return back the string as it is back to the client. (The code will be modified later such that the string is processed before sending back). The client will send a string whenever needed to the server. Thus it means it is compulsory for the server to be running for indefinite