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
9
votes
2 answers

How to send images through sockets in java?

I am writing a client-server program and I want that to send an image. The code is the following: //RECEIVER while(true){ try{ socket = server.accept(); out = new ObjectOutputStream(socket.getOutputStream()); …
enemy
  • 101
  • 1
  • 1
  • 3
9
votes
5 answers

C# SQLServer retrieving results and place in a .csv format

I had a look on the site and on Google, but I couldn't seem to find a good solution to what I'm trying to do. Basically, I have a client server application (C#) where I send the server an SQL select statement (Connecting to SQL Server 2008) and…
Erika
  • 2,045
  • 7
  • 25
  • 31
9
votes
2 answers

Why can't I trust a client-generated GUID? Does treating the PK as a composite of client-GUID and a server-GUID solve anything?

I'm building off of a previous discussion I had with Jon Skeet. The gist of my scenario is as follows: Client application has the ability to create new 'PlaylistItem' objects which need to be persisted in a database. Use case requires the…
Sean Anderson
  • 27,963
  • 30
  • 126
  • 237
9
votes
1 answer

Is socket creation-deletion very expensive process?

I am working on a client/server application. I have ready many articles for this and found a very common statement that "Creation/deletion of socket is very expensive process in terms of using system resources". But no where it is explained how it…
Nipun
  • 2,217
  • 5
  • 23
  • 38
9
votes
2 answers

How to connect android client to the localhost of Apache server (php) inside my laptop?

I'm trying to create android apps which able sending data through wifi connection to my laptop Apache Server and MySQL database. I use the samsung galaxy tab 10.1 as my mobile device. and the protocol i used is HttpGet or HttpPost. And i use XAMPP(…
user1796310
  • 91
  • 1
  • 2
9
votes
3 answers

SQLite for client-server

I've seen a couple of SQLite performance questions here on Stackoverflow, but the focus was on websites, and I'm considering using this DB in a client-server scenario: I expect 1-10 clients for one server for now, could go up to 50 or more in the…
rpg
  • 7,746
  • 3
  • 38
  • 43
9
votes
1 answer

what is the difference between System.Net.Cookie and System.Web.HttpCookie?

I obtain a HTTPCookie, but need a Net.Cookie. Are they just something you can recast, or how would i go about it?
Fallenreaper
  • 10,222
  • 12
  • 66
  • 129
9
votes
1 answer

How to validate self-signed certification

i will provide you with my question clearly so you can answer me I have a client-server (socket) connection that i secured using SslStream and as i know using ssl makes me sure that my client will only connect to my server And to do that i must add…
Daniel Eugen
  • 2,712
  • 8
  • 33
  • 56
9
votes
2 answers

Client-Server database application: how to notify clients that data was changed?

Is it possible to know when and if the contents of certain tables in a database has changed? How can my SQL Server notify the client applications that the data was changed by another user? How to implement query notifications with dbGo ? Do my…
ZigiZ
  • 2,480
  • 4
  • 25
  • 41
8
votes
3 answers

What is the best, most efficient, Client pool technique with Erlang

I'm a real Erlang newbie (started 1 week ago), and I'm trying to learn this language by creating a small but efficient chat server. (When I say efficient I mean I have 5 servers used to stress test this with hundreds of thousands connected client -…
TheSquad
  • 7,385
  • 8
  • 40
  • 79
8
votes
3 answers

How to update ListView on scrolling while retrieving data from server in Android?

Currently, I'm using AsyncTask to handle Http connection and retrieve data as JSON format. Loading all data is trivial but it consumes too much time, so I decided to switch to load 10 items at a time using LIMIT OFFSET (mysql). Next I set up the…
Cathy
  • 91
  • 1
  • 1
  • 6
8
votes
1 answer

Monitor.Wait/Pulse race condition in a multithreaded server

I'm having a problem with interlocked Monitor.Wait and Monitor.Pulse in a multi-threaded TCP server. To demonstrate my issues, here is my server code: public class Server { TcpListener listener; Object sync; IHandler handler; bool…
Simon Haines
8
votes
8 answers

Why is Java on Server and C# on Client a popular choice?

I have seen a few examples where the architecture is that there is java on the server side and c# on the client - what makes this combination so good? why would .net on both sides not be a better choice (or in fact, java on both sides?) added later:…
Simon P
  • 1,196
  • 1
  • 12
  • 26
8
votes
5 answers

How do I obtain the latency between server and client in C#?

I'm working on a C# Server application for a game engine I'm writing in ActionScript 3. I'm using an authoritative server model as to prevent cheating and ensure fair game. So far, everything works well: When the client begins moving, it tells the…
DfKimera
  • 2,076
  • 2
  • 21
  • 39
8
votes
3 answers

Indy Write Buffering / Efficient TCP communication

I know, I'm asking a lot of questions...but as a new delphi developer I keep falling over all these questions :) This one deals with TCP communication using indy 10. To make communication efficient, I code a client operation request as a single byte…
jpfollenius
  • 16,456
  • 10
  • 90
  • 156