Ask you a great God,
There is currently a need to specify the server to the LAN computer needs push files , file types, including HTML, images , js, css , etc., so consider using a socket implementation
brother can not be considered ServerSocket build on all client computers within the LAN , on the server side to establish Socket, when the server receives a command to the specified client ServerSocket to establish a connection and complete file push through the flow
online probably looked, seemingly no way to ServerSocket created in the client's case , do not know where to place unreasonable ? Personal feelings do not only reduce the pressure on the server , but also need to consider the number of threads and concurrency issues , ask God to do great work? If feasible , the problem is where is it ? Brother Caishuxueqian , the problem may be naive , but please let us know
------ Solution ---------------------------- ----------------
can , but there are problems .
also have concurrency issues now , do not you prepare a one push ? Will not reduce the pressure on the server . socket connection is established after the ends are equal.
you sure this idea is to open a fixed port the client , if the client port is in use , what strategies redistribution ? How to tell the server the client's new port.
server to do the most realistic approach to delay pushing big data , that is, the client connects to the server , the server queue , there is free time again to send
------ Solution ------- -------------------------------------
ideas you can try :
server sends a command to the client , telling the client has the file to be updated .
After the client receives this command to the server to download.
This will not let the client do the server , role clarity. In addition, the server can also control which services when clients come download !
------ Solution ---------------------------------------- ----
LZ somewhat rebellious ideas .
server's side as a server, listening fixed port ; client connections the server download various files.
data push problem, there are two options:
1. clients periodically sends a request to see if the server has no data to be transferred , if there is to immediately download.
2. client and server to establish a long connection , when the server has data to send , when connected via long push data .
However, this implementation is more complex, not recommended for beginners.
------ For reference only ---------------------------------- -----
security a big problem
------ For reference only ------------------------ ---------------
I still use the first second method it feels good hey nc
没有评论:
发表评论