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
13
votes
3 answers

How Server Sent Event send response to a specific client

In Server Sent Event, it always send the same response to all the client. but what i want to know is, How to send response to an only one client using java. this is my event which define inside sw.js (SSE) var eventSource = new…
13
votes
1 answer

Avoid Windows Firewall popup with sockets on localhost

I have written a simple Java application that interacts with multiple instances of itself using sockets. The first instance automatically takes on the role of the server, listening on a specific port, and all subsequent instances connect to it. The…
Paul Lammertsma
  • 37,593
  • 16
  • 136
  • 187
13
votes
9 answers

Why can't the server get the client MAC address, like the client IP?

From what I know, all the MAC addresses that the packet gone through are in the packet. This is because that each packet that goes in a certain path, should also be returned in similar path. So, if the router of the server know about the mac address…
stacker
  • 14,641
  • 17
  • 46
  • 74
13
votes
1 answer

Options for Client Server Communication in Android

I'm currently in the research phase of my dissertation project. My project is a ticket booking system for a mobile device and I have chosen to target Android. I anticipate the need for a client/server architecture with a central server, and so am…
chrisbunney
  • 5,819
  • 7
  • 48
  • 67
13
votes
2 answers

Git repository setup for a project that has a server and client

I am part of a project that is starting up that will have a client executable and a server executable. We are using git to help keep our team updated with code and this is the first time for many of us using git (This project is for a class). I am…
CodeNeko
  • 235
  • 3
  • 9
13
votes
3 answers

How to build a distributed java application?

First of all, I have a conceptual question, Does the word "distributed" only mean that the application is run on multiple machines? or there are other ways where an application can be considered distributed (for example if there are many independent…
Sami
  • 7,797
  • 18
  • 45
  • 69
12
votes
5 answers

The AJAX response: Data (JSON, XML) or HTML snippet?

I'm just wondering what is an "ideal" output format for the AJAX response? Pure data (JSON, XML) rendered into the page using some client-side JavaScript template engine? Or an HTML snippet rendered into the page "as-is"? What is your preference and…
parxier
  • 3,811
  • 5
  • 42
  • 54
12
votes
3 answers

Multiple client to server communication program in Java

I wrote a server-client communication program and it worked well. Client module import java.io.*; import java.net.*; class Client { public static void main(String argv[]) throws Exception { String sentence; String…
kiddo
  • 1,596
  • 7
  • 31
  • 60
12
votes
1 answer

Node.js and client sharing the same scripts

One of the theoretical benefits from working with Node.js is the possibility to share the same scripts between clients and the server. That would make it possible to degrade the same functionality to the server if the client does not support…
David Hellsing
  • 106,495
  • 44
  • 176
  • 212
12
votes
6 answers

Should my server use both TCP and UDP?

I'm writing a client/server application and really can't find guides that fit my need. Doing it on my own leads me to many design flaws before I've even begun. For instance the server should update every client as to its state many times each…
user2651804
  • 1,464
  • 4
  • 22
  • 45
12
votes
5 answers

How should I stress test / load test a client server application?

I develop a client-server style, database based system and I need to devise a way to stress / load test the system. Customers inevitably want to know such things as: • How many clients can a server support? • How many concurrent searches can a…
jkp
  • 78,960
  • 28
  • 103
  • 104
12
votes
1 answer

How to reconnect a socket on asyncio?

I would like to create two protocols (TcpClient and UdpServer) with asyncio on app.py where the TcpClient will have a persistent connection with the server.py and UdpServer serving as UDP Server: What I need: a) That both protocols to communicate:…
Beyonlo Sam
  • 133
  • 1
  • 1
  • 5
12
votes
1 answer

Setting up an R-Server that supports asynchronous communication with clients

In short Is it possible set up an R-Server that can handle/dispatch multiple client requests in an asynchronous way? I guess I'm looking for some sort of socket communication. Or is there something even more efficient to let R talk to other…
Rappster
  • 12,762
  • 7
  • 71
  • 120
12
votes
2 answers

Accessing virtual host from computer on same local network

I am trying to make a setup so that I can access my website on a virtual host in computer A from computer B. Both A and B are on the same network. I am using xampp on Win 7. So here is as the problem goes computer A(server) has a virtual host…
codisfy
  • 2,155
  • 2
  • 22
  • 32
11
votes
1 answer

JmDNS service discovery in client-server

I'm trying to enable service discovery in my client-server application using JmDNS. I fully understand service registry on the server side, with code that resembles this: JmDNS jmdns = JmDNS.create(localhost); jmdns.register(serviceInfo); However,…