[xSocket-develop] [discusstion] applying xSocket to implement an effective and robust file server
Status: Inactive
Brought to you by:
grro
|
From: beijing w. <wel...@gm...> - 2008-11-17 16:43:48
|
hi, a discussion for applying xSocket to implement an effective and robust file server. a TCP server stores lots of small pictures (from 1k to 5k for each size). a client downloads pictures from server frequently, but seldom do uploading job. as far as i know for xSocket, the server can use SERVER: transferFrom a FileChannel to BlockingConnection in on IDataHandler.onData() CLIENT: can use transferTo a FileChannel from BlockingConnection the communication between client and server has two steps: 1. client sends a query to server, server send back the pictures list which need to download. 2. client begins to download the pictures from server. if the client need to download more than 10 pictures in a seconds, then it seems reasonable to use multi thread. the question is how to design in server side. 1) if use multi thread, how to write the IDataHandler.onData()? if it's BlockingConnection, will it block other threads for this connection? if NonBlockingConnection, need to write to bytebuffer.duplicate()? 2) if many clients connect to the same server (e.g. more than 10k), the multi thread will rise the connection number? how to minimize the load of server? if use proxy to do load balance, any other problem? what's your opinion? any comments are appreciated. |