Questions tagged [client-server]

DO NOT USE ALONE. The client-server model is a centralized model, in which a server performs a specialized service (such as HTTP, SMTP, etc.) for multiple clients on request. Use for issues regarding client server communication. Use with a appropriate language tag(eg: [python]).

The client-server centralized model is a model in which servers perform services for many clients, who request them, typically over a network. The client-server model contrasts with the peer-to-peer model.

Typically, a client-server interaction will work as such:

  1. The client connects to the server and issues a request. The request is formatted to any one of a number of protocols, depending on the server type.
  2. The server receives the request, and begins processing it. While this happens, the client is made to wait.
  3. The server sends the client a response which typically contains both a status (whether or not there was an error) and content (which is whatever the client asked for originally).
  4. The client or the server can either terminate the connection, or keep it alive for further requests.

Writing in a client-server domain presents a number of challenges:

  • Many, many clients may be requesting services at any given time. This issue is commonly faced by websites, and is typically solved with multiple layers of load-balancing and caching. Wikipedia's architecture is an example of this (albeit an unusually complex example).
  • Networks can easily become unreliable, and sessions can be terminated at any time.
  • Security can be an issue, due to security compromises like a Man In The Middle attack. Cryptography algorithms (like SSL) are widely deployed in various networking areas to combat this.
6508 questions
15
votes
4 answers

Mongodb client side javascript api

I would like to use mongodb directly from the client-side, using javascript inside my models. I suppose this is possible since on the mongo website there is a javascript realtime console for demo. Does exist a way to use the same api in a normal…
Bakaburg
  • 3,165
  • 4
  • 32
  • 64
15
votes
5 answers

How to pass a parameter to html?

I have a script that uses the file picker but I need to pass a specific parameter which is called userId and is kept as a global variable in the calling script. As the calls are asynchronous it seems I cannot access this parameter. Is there a way to…
15
votes
5 answers

What is the best way for a client app to find a server on a local network in C#?

The client connects to the server using GenuineChannels (we are considering switching to DotNetRemoting). What I mean by find is obtain the IP and port number of a server to connect to. It seems like a brute-force approach would be try every IP on…
Davy8
  • 30,868
  • 25
  • 115
  • 173
15
votes
1 answer

Best practice for android client to communicate with a server using threads

I am building an android app that communicates with a server on a regular basis as long as the app is running. I do this by initiating a connection to the server when the app starts, then I have a separate thread for receiving messages called…
Bob
  • 2,586
  • 7
  • 20
  • 33
15
votes
3 answers

C socket: recv and send all data

I would like to obtain a behavior similar to this: Server run Client run Client type a command like "help" or other Server responds appropriately go to 3 The problem is that when my function excCommand("help") run just a little text is received…
Lorenzo Cinque
  • 954
  • 1
  • 14
  • 22
15
votes
6 answers

Compile Vim 7.3 with +clientserver feature on Mac OS X

How do I compile Vim with the clientserver feature on Mac OS X? I have the vim-7.3.tar.bz2 source I understand that MacVim has this built in, but it only works when the GUI is running. I want to work with a CLI version, as my work is so much easier…
Kit
  • 30,365
  • 39
  • 105
  • 149
14
votes
2 answers

Trying to create a simple Ruby server over SSL

I am trying to create a simple SSL client and server in Ruby. But I'm getting a cryptic error message and the documentation is of no help. Here is my server code: #!/usr/bin/ruby require "gserver" require "openssl" listeningPort =…
Fantius
  • 3,806
  • 5
  • 32
  • 49
14
votes
5 answers

Safest way to update game score from client to server database? Javascript

So I have this game that is completely run on the client. No server interaction what so ever apart from downloading the initial scripts to play the game. Anyway at the end of the game I would like for the client to send me back the scores which…
Shouvik
  • 11,350
  • 16
  • 58
  • 89
14
votes
2 answers

WinForms to WPF - How do we get there from here?

Is there a practical way for us to slowly evolve a WinForms application to WPF without creating a support nightmare for ourselves with strange interop scenarios? Background info: We have a large battleship gray WinForms application that is heavily…
Paul G
  • 2,722
  • 4
  • 37
  • 54
14
votes
2 answers

Synchronizing partial database model from server to client

This is more of a conceptual question not necessarily bound to any specific technologies. Lets say you got some database on a server, some REST/JSON API to access content in that database and some mobile client displaying data retrieved through the…
mibollma
  • 14,959
  • 6
  • 52
  • 69
14
votes
4 answers

MVC: why do we need "controller", or when should we use this pattern?

I have read many publications about MVC, but I still can't clearly understand why do we need "controller". I usually write applications in client-server model: server contains all the business-logic, and it knows nothing about the gui. It does the…
Dmitry Frank
  • 10,417
  • 10
  • 64
  • 114
14
votes
4 answers

How to copy a file on the FTP server to a directory on the same server in Java?

I'm using Apache Commons FTP to upload a file. Before uploading I want to check if the file already exists on the server and make a backup from it to a backup directory on the same server. Does anyone know how to copy a file from a FTP server to a…
itro
  • 7,006
  • 27
  • 78
  • 121
14
votes
4 answers

Loading javascript in body onload with 2 functions

I am trying to load 2 javascript events/functions in the body onload as follows :-
Paul Clubs
  • 141
  • 1
  • 1
  • 3
13
votes
1 answer

Socket vs HTTP based communication for a mobile client/server application

I've recently decided to take on a pretty big software engineering project that will involve developing a client-server based application. My plan is to develop as many clients as possible: including native iPhone, Android and Blackberry Apps as…
Casey Flynn
  • 13,654
  • 23
  • 103
  • 194
13
votes
2 answers

Android Client Server communication

I have an application in Android which get latitude and longitude from GPS. I want to send these lat and long to server at particular port and want to receive the response of server into my Android application. Kindly give the direction so that I…
Siddiqui
  • 7,662
  • 17
  • 81
  • 129