CN103501245B - Network-event processing method and device - Google Patents
Network-event processing method and device Download PDFInfo
- Publication number
- CN103501245B CN103501245B CN201310446725.9A CN201310446725A CN103501245B CN 103501245 B CN103501245 B CN 103501245B CN 201310446725 A CN201310446725 A CN 201310446725A CN 103501245 B CN103501245 B CN 103501245B
- Authority
- CN
- China
- Prior art keywords
- socket
- client
- monitoring
- data
- connection socket
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Landscapes
- Computer And Data Communications (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
The invention provides a network-event processing method and device. The network-event processing method comprises the following steps of: when being called by a protocol stack, judging whether listening sockets are in a linking request state, distributing preset scheduling quota to the listening sockets in the linking request state; in one scheduling quota preset for one listening socket, when receiving a data transmission request of a client side every time, creating connecting sockets communicating with the client side; creating connecting objects communicating with the client side by the connecting sockets, transmitting data sent by the client side to the connecting objects by the connecting sockets, and returning obtained processing result data to the client side by the connecting sockets after the data is processed by the connecting objects. The network-event processing method and device provided by the invention have the advantages that triggering and processing of network events are realized on the same device, the activation and processing process is a continuous process when the triggering process is ended, so that the processing speed of the network events is accelerated, and the event processing speed of a multi-core processing server is increased.
Description
Technical field
The present invention relates to communication technical field, more particularly to a kind of network event processing method and device.
Background technology
With the development of internet information transmission technology, increasing server to solve network using polycaryon processor
The problem of event high concurrent.The process to network event for the server, the method commonly used at present is User space poll processing mode, adopts
Realize synchronous non-obstruction input/output with the event handling layer of operating system nucleus(non-blocking I/O)And multichannel is multiple
With(multiplexing).
User's polling mode processes network event and is broadly divided into two steps:Event triggers step:Network interface card in server
Receive the network service request data of client transmission, network interface card is by network service request data by connected one
The data cache region that reason device is sent to network protocol stack enters row cache, and network protocol stack calls number described in event handling layer labelling
According to buffer zone for data storage state;Event processing steps:It is slow to network protocol stack that client layer passes through a processor
Deposit region active poll, when being polled to the state that buffer zone is data storage, client layer reads the number of data cache region
According to.
To read data instance, data is sent to the network interface card of server from client, and the data receiving is passed through by network interface card
The data cache region that one processor is sent to network protocol stack enters row cache, and network protocol stack calls event handling layer labelling
Described data cache region is the state of data storage;Client layer passes through the buffer zone master to network protocol stack for the processor
Driving wheel is ask, and when being polled to the state that buffer zone is data storage, client layer reads the data of data cache region.If user
The result of layer poll is that data cache region does not have data to enter row cache, then continue poll.
When those skilled in the art adopt said method to process network event, find to have a disadvantage that:
During above-mentioned process network event, the triggering of event and the process of event are two detached processes, network interface card
Data is transmitted data to buffer zone storage by a processor;Client layer passes through a processor poll buffer zone
Storage state, the triggering of event and the process of event for different processor queues, may lead to triggering and the thing of event
Produce certain time interval between the process of part, lead to event handling to be postponed, reduce the event of multinuclear processing server
Processing speed.
Content of the invention
In view of this, the invention provides a kind of network event processing method and device, pass when receiving client data
During defeated request, create the connection socket with client communication, create and pass through the described company connecting socket communication with client
Connect object, the data that client is sent is delivered to by described connection socket and is processed with described connecting object, event
Triggering and processing procedure processes on same device, and activation processing procedure at the end of trigger process, accelerate network thing
Part processing speed.
A kind of network event processing method, methods described includes:
When being called by protocol stack, judge to monitor the state whether socket is hyperlink request, described monitoring socket
Word is used for monitoring the linking request of at least one client that port associated with it is received;
Distribute default scheduling quota to the monitoring socket of the state of hyperlink request, described default scheduling quota is right
The operating time monitoring the data processing request of at least one client that socket is monitored belonging to it;
One monitor socket default scheduling quota in, often receive a client data processing request when,
Create the connection socket with described client communication;
Create and pass through the described connecting object connecting socket communication with client;
The data that described client is sent is delivered to described connecting object by described connection socket, so that described company
Connect after object processes to described data, the result obtaining data is returned to by described connection socket described
Client.
Optionally, methods described also includes:
Monitor in socket default scheduling quota at one, when creating connection socket failure, abandon described monitoring
Socket.
Optionally, methods described also includes:
When monitoring socket default scheduling quota beyond one, if remaining to successfully create connection socket, again
For described monitoring socket allocation schedule quota.
Optionally, the described data sending described client is delivered to described connecting object by described connection socket
Including:
The identification described connection corresponding connecting object of socket;
Call the described call back function connecting socket;
Using described call back function, the data that described client sends is delivered to described company by described connection socket
Connect object.
Optionally, methods described also includes:
When described data processing finishes or data processing is abnormal, delete described connection socket.
Optionally, described deletion described connection socket includes:
Delete Preset Time to described connection socket setting;
When reaching deletion Preset Time, delete described connection socket.
A kind of network event processing meanss, described device includes:
Judging unit, for when being called by protocol stack, judging to monitor the state whether socket is hyperlink request,
Described socket of monitoring is used for monitoring the linking request of at least one client that port associated with it is received;
Allocation unit, the monitoring socket for the state to hyperlink request distributes default scheduling quota, described default
Scheduling quota by belonging to it monitor the data processing request of at least one client that socket is monitored operation when
Between;
First creating unit, for monitoring in socket default scheduling quota at one, often receives a client
Data processing request when, create and the connection socket of described client communication;
Second creating unit, passes through the described connecting object connecting socket communication for creating with client;
Processing unit, it is right that the data for sending described client is delivered to described connection by described connection socket
As so that after described connecting object is processed to described data, the result obtaining data being passed through described connection socket
Word returns to described client.
Optionally, described device also includes:
Discarding unit, for monitoring in socket default scheduling quota at one, when creating connection socket failure,
Abandon described monitoring socket.
Optionally, described device also includes:
Redistribute unit, for when monitoring socket default scheduling quota beyond one, if remaining to successfully create
Connect socket, be then described monitoring socket allocation schedule quota again.
Optionally, described processing unit includes:
Identification subelement, for identifying the described connection corresponding connecting object of socket;
Call subelement, for calling the described call back function connecting socket;
Send subelement, for the data that described client sends being passed through described connection socket using described call back function
Word is delivered to and described connecting object, so that after described connecting object is processed to described data, by the result obtaining
Data returns to described client by described connection socket.
Optionally, described device also includes:
Delete unit, for when described data processing finishes or data processing is abnormal, deleting described connection socket.
Optionally, described deletion unit includes:
Setting subelement, for deleting Preset Time to described connection socket setting;
Delete subelement, for when reaching deletion Preset Time, deleting described connection socket.
The above is had to understand, the method have the advantages that:
The invention provides a kind of network event processing method and device, when being called by protocol stack, judge to monitor
Whether socket is the state of hyperlink request, distributes default scheduling quota to the monitoring socket of the state of hyperlink request,
One monitor socket default scheduling quota in, often receive a client data transfer request when, create with described
The connection socket of client communication;Create and pass through the described connecting object connecting socket communication with described client, by institute
The data stating client transmission is delivered to and described connecting object by described connection socket, so that described connecting object is to institute
State after data processed, the result obtaining data is returned to described client by described connection socket.Net
The trigger process of network event is the data transfer request receiving client, and the processing procedure of event is to create and client communication
Connection socket, create with client pass through described connect socket communication connecting object, the data of client is passed through
Described connection socket is delivered to described connecting object and is processed, and result data is returned by described connection socket
Return to described client, the trigger process of event is a continuous process with processing procedure, and processes on same device,
Improve the cache hit rate of device, accelerate the processing speed of network event, improve the event handling of multinuclear processing server
Speed.
Brief description
In order to be illustrated more clearly that the embodiment of the present invention or technical scheme of the prior art, below will be to embodiment or existing
Have technology description in required use accompanying drawing be briefly described it should be apparent that, drawings in the following description be only this
Some embodiments of invention, for those of ordinary skill in the art, on the premise of not paying creative work, acceptable
Other accompanying drawings are obtained according to these accompanying drawings.
Fig. 1 is a kind of present invention network event processing method embodiment one flow chart;
Fig. 2 is a kind of present invention network event processing method embodiment two flow chart;
Fig. 3 is a kind of present invention network event processing meanss embodiment three structural representation;
Fig. 4 is a kind of present invention network event processing meanss example IV structural representation.
Specific embodiment
A kind of a kind of the invention provides network event processing method and device, the invention provides network event process side
Method and device, when receiving client data transmission request, create the connection socket with client communication, create and client
End is delivered to by described connection socket by the described connecting object connecting socket communication, the data that client is sent
At described connecting object, the triggering processing procedure of event is a continuous process, improves multinuclear processing server
Event handling speed.
Below in conjunction with the accompanying drawings the specific embodiment of the invention is described in detail.
Embodiment one
Fig. 1 is a kind of present invention network event processing method embodiment one flow chart, and methods described includes:
Step 101:When being called by protocol stack, judge to monitor the state whether socket is hyperlink request, if
It is, execution step 102, if not, execution step 106.
The corresponding monitoring socket in each port of server, described monitoring socket is used for monitoring end associated with it
The linking request of at least one client that mouth is received.When server monitors socket initialization, kernel server system is set
System monitors the sk_data_ready call back function of socket.
At least one client passes through a port by the network interface card of linking request data is activation to server, and network interface card will link
Request data is sent to the protocol stack of core system, and linking request data is entered row cache by protocol stack, obtains and closes with described port
The monitoring socket of connection, and call core system to monitor the sk_data_ready call back function of socket.
Call back function judges to connect the state monitoring socket, the state being hyperlink request when the state monitoring socket, then
Described monitoring socket is put into a monitoring queue.Monitor the monitoring socket that queue is that a placement meets hyperlink request state
The queue of word, using the principle of first in first out, the monitoring socket being introduced into monitoring queue first ejects;Enter afterwards and monitor queue
Eject that is to say, that first processing the monitoring socket being introduced into after monitoring socket, the monitoring socket entering after reprocessing.
The number monitoring the monitoring socket that can arrange on queuing theory does not limit, in the memory range of server.
Step 102:Distribute default scheduling quota to the monitoring socket of the state of hyperlink request.
The monitoring that queue is monitored in call back function activation processes thread, is arranged in the monitoring socket monitoring in queue according to suitable
Sequence ejects one by one, monitors and processes thread to the monitoring socket default scheduling quota of setting ejecting.Described default scheduling is joined
Volume is the operating time of the data processing request monitoring at least one client that socket is monitored belonging to it, that is,
Say, default scheduling quota is the described operating time monitoring socket.Illustrate, if default scheduling quota is 10s, place
Reason monitors the data processing request of all clients that socket is listened in 10s.
In default scheduling quota, process all currently processed sockets of monitoring as far as possible and listened at least
The data processing request of one client.Beyond default scheduling quota or processed currently processed monitoring socket and monitored
After the data processing request of all clients arriving, eject next monitoring socket, pre- for next monitoring socket distribution
If scheduling quota.
Step 103:Monitor in socket default scheduling quota at one, often receive the data processing of a client
During request, create the connection socket with described client communication.
Monitor process thread to monitor after socket distribution default scheduling quota to one, monitoring socket often listens to one
During the data processing request of individual client, create a connection socket with described client communication.Monitor socket to monitor
The data processing that at least one client that port associated with it is received sends is asked.Monitoring socket can receive different
The data processing request that client sends, monitor process thread be each client individually create one with client communication
Connect socket, one is connected socket and communicated with a client.
The connection socket of generation is sent to factory's queue, factory's queue is the connection socket placed with client communication
The queue of word.
Monitor the monitoring socket default scheduling quota of distribution processing thread mainly to hyperlink request state, locate to current
The client that the monitoring socket of reason is listened to creates a connection socket, connection socket is sent to factory's queue and enters
Row subsequent treatment, so can ensure that monitoring process thread is not blocked, effectively raises the process energy of concurrent connection request
Power.
Step 104:Create and pass through the described connecting object connecting socket communication with client.
It is right that factory processes thread creates a connection according to the connection socket ejecting in factory's queue in core system
As described connecting object is communicated with client by described connection socket.Connect a pair of socket and connecting object 1
Should, establish client and and connecting object between data transmission channel.
Step 105:The data that described client is sent is delivered to described connecting object by described connection socket, with
Toilet is stated after connecting object processes to described data, and the result obtaining data is returned by described connection socket
Return to described client.
Event handling thread identifies the type connecting the client data that socket receives that factory's queue is ejected, according to institute
The type stating data calls the call back function matching with described data type.
When receiving from the data of client, call sk_data_ready call back function;
When the relief area of network protocol stack is writeable, call sk_write_space call back function;
When connecting the state change of socket, call sk_state_chuange call back function.
The connection socket that have invoked call back function is sent to transaction queues, transaction queues as a data processing event
In pending concrete data processing event is placed, using the principle of first in first out, the data that successively client sent
Processed.
Event handling thread is processed to the process event that transaction queues eject, that is, will be described using described call back function
The data that client sends is passed through described connection socket and is delivered to described connecting object.Due to described connecting object and client
End communication, after connecting object will be processed to described data, the result obtaining data is socketed by described connection
Word returns to described client.
Step 106:Abandon described monitoring socket.
When monitoring the state that socket is not hyperlink request, abandon described monitoring socket.
As shown in the above, the method have the advantages that:
When being called by protocol stack, judge to monitor the state whether socket is hyperlink request, to hyperlink request
The monitoring socket of state distributes default scheduling quota, monitors in socket default scheduling quota at one, often receives
During the data transfer request of one client, create the connection socket with described client communication;Create and described client
By the described connecting object connecting socket communication, the data that described client is sent passes through described connection socket transmission
Arrive and described connecting object, so that after described connecting object is processed to described data, the result obtaining data is led to
Cross described connection socket and return to described client.The trigger process of network event is the data transfer receiving client
Request, the processing procedure of event is the connection socket creating with client communication, creates and passes through described adapter sleeve with client
Connect the connecting object of word communication, the data of client is delivered at described connecting object by described connection socket
Reason, result data is returned to described client by described connection socket, the trigger process of event with processed
Journey is a continuous process, and processes on same device, improves the cache hit rate of device, accelerates network event
Processing speed, improves the event handling speed of multinuclear processing server.
Embodiment two
Fig. 2 is a kind of present invention network event processing method embodiment two flow chart, compared with embodiment one, embodiment two
In also include to the delete processing connecting socket, methods described includes:
Step 201:When being called by protocol stack, judge to monitor the state whether socket is hyperlink request, if
It is, execution step 202;If not, execution step 210.
Step 202:Distribute default scheduling quota to the monitoring socket of the state of hyperlink request.
Described default scheduling quota is by monitoring at the data of at least one client that socket is monitored to affiliated
The operating time of reason request.
Step 201 is similar with embodiment one with step 202, the description of reference implementation example one, repeats no more here.
Step 203:Judge whether to monitor in socket default scheduling quota at one, if it is, execution step 204,
If not, execution step 208.
When monitoring in socket default scheduling quota, process as far as possible and monitor all visitors that socket is listened to
The data processing request that family end sends.
Step 204:Often receive a client data processing request when, create and the connection of described client communication
Socket, connects whether socket creates successfully, if it is, execution step 205;If not, execution step 210.
In the default scheduling quota monitoring socket, often receive the data processing request of a client, that is, create
Build a connection socket with described client communication.Similar with embodiment one herein, the description of reference implementation example one, here
Repeat no more.
Connect socket and create successfully, then create and pass through the described connecting object connecting socket communication with client;Even
Connect socket establishment unsuccessful, represent that the data processing request monitoring all clients that socket is listened to is disposed,
Abandon described connection socket.
Step 205:If connecting socket to create successfully, create with client by the described connection connecting socket communication
Object.
Step 206:The data that described client is sent is delivered to described connecting object by described connection socket, with
Toilet is stated after connecting object processes to described data, and the result obtaining data is returned by described connection socket
Return to described client.
Step 205 is similar with embodiment one with step 206, the description of reference implementation example one, repeats no more here.
Step 207:When described data processing finishes or data processing is abnormal, delete described connection socket.
When data transfer finishes or during transmission abnormality, event handling thread adds to described connection socket and deletes mark
Know, and be sent to factory's queue by with the addition of the connection socket deleting mark, factory's queue is deleted with the addition of and deleted mark
Connect socket.
Optionally, event handling thread is given with the addition of and is deleted the connection socket setting of mark and delete Preset Time, when arriving
When reaching deletion Preset Time, delete described connection socket.
The execution of factory processes thread creates with client by the described connecting object connecting socket communication and deletion
With the addition of two process tasks of connection socket deleting mark, wherein, create connecting object using scheduling strategy as far as possible,
As long as also having in factory's queue and connecting socket, just pass through the described connecting object connecting socket communication with client;Delete
With the addition of the connection socket deleting mark using delay disposal strategy, the connection socket that with the addition of deletion mark to each sets
Putting a deletion Preset Time, when reaching deletion Preset Time, then deleting to the addition of the connection socket deleting mark
Remove.So, factory processes thread first can process pending connection socket as soon as possible, then delay disposal deletes idle company
Connect socket, release event processes space, improve the disposal ability of concurrent event to greatest extent.
Step 208:Connect whether socket creates successfully, if it is, execution step 209;If not, execution step 210.
Step 209:If connecting socket and creating successfully, again for described monitoring socket allocation schedule quota.
When exceeding default scheduling quota, the data processing request monitoring all clients that socket is monitored also does not have
There is end of operation that is to say, that when exceeding default scheduling quota, this monitors socket and also listens at the data of client
Reason request, then be reentered into monitoring queue by this monitoring socket, again monitors socket for this and distributes default scheduling quota.
Illustrate:If having tcp to monitor socket in monitoring queue successively, unix monitors socket and linux monitors
Socket, processes the data processing request that tcp monitors the client that socket listens to, when pre- more than tcp monitoring socket
If scheduling quota when, tcp monitors socket and also listens to the data processing request of client, then tcp is monitored socket weight
Newly put into monitoring queue, after being arranged in linux monitoring socket, unix monitors socket and linux monitors set when having processed
After connecing word, then monitor the socket default scheduling quota of distribution to tcp, continue with tcp and monitor the client that socket listens to
The data processing request at end.
Step 210:If connecting socket to create unsuccessfully, abandon described connection socket.
As shown in the above, the present invention also has the advantages that:
Monitor process thread and be sent to factory's queue by connecting socket, factory processes thread creation passes through institute with client
The connecting object of the connection socket communication ejecting, monitors process thread and is only responsible for processing the data processing request monitoring client
Event;The data that client sends is delivered to described company by described connection socket by event handling thread dispatching call back function
Connect object, finish to data processing or the connection socket interpolation deletion mark of data processing exception is sent to factory's queue, thing
Part processes the process that thread is only responsible for the data of client;Factory's queue is responsible for generating connecting object, and deletes and with the addition of deletion
The connection socket of mark, release event processes space, and auxiliary is monitored and processed thread and event handling thread it is ensured that monitoring is processed
Thread does not block, and improves the disposal ability of concurrent linking request to greatest extent;Delete idle connection socket, discharge data
Process space, improve the disposal ability of concurrent transaction to greatest extent.
Embodiment three
Fig. 3 is a kind of present invention network event processing meanss embodiment three structural representation, and embodiment three is and embodiment
The device corresponding to method described in one, described device includes:
Judging unit 301, for when being called by protocol stack, judging to monitor the shape whether socket is hyperlink request
State.
Described socket of monitoring is used for monitoring the request of at least one client that port associated with it is received.
Allocation unit 302, the monitoring socket for the state to hyperlink request distributes default scheduling quota.
Described default scheduling quota is by monitoring at the data of at least one client that socket is monitored to affiliated
The operating time of reason request.
First creating unit 303, for monitoring in socket default scheduling quota at one, often receives a client
During the data processing request at end, create the connection socket with described client communication.
Second creating unit 304, passes through the described connecting object connecting socket communication for creating with client.
Processing unit 305, the data for sending described client is delivered to described company by described connection socket
Connect object, so that after described connecting object is processed to described data, by the result obtaining data by described connection
Socket returns to described client.
Optionally, described processing unit 305 includes:
Identification subelement 306, for identifying the described connection corresponding connecting object of socket;
Call subelement 307, for calling the described call back function connecting socket;
Send subelement 308, for the data that sends described client using described call back function by described connection
Socket is delivered to and described connecting object, so that after described connecting object is processed to described data, by the process obtaining
Result data returns to described client by described connection socket.
Example IV
Fig. 4 is a kind of present invention network event processing meanss example IV structural representation, and example IV is and embodiment
The device corresponding to method described in two, described device includes:
Judging unit 301, for when being called by protocol stack, judging to monitor the shape whether socket is hyperlink request
State.
Described socket of monitoring is used for monitoring the linking request of at least one client that port associated with it is received.
Allocation unit 302, the monitoring socket for the state to hyperlink request distributes default scheduling quota.
Described default scheduling quota is by monitoring at the data of at least one client that socket is monitored to affiliated
The operating time of reason request.
First creating unit 303, for monitoring in socket default scheduling quota at one, often receives a client
During the data transfer request at end, create the connection socket with described client communication.
Second creating unit 304, passes through the described connecting object connecting socket communication for creating with client.
Processing unit 305, the data for sending described client is delivered to described company by described connection socket
Connect object, so that after described connecting object is processed to described data, by the result obtaining data by described connection
Socket returns to described client.
Optionally, described processing unit 305 includes:
Identification subelement 306, for identifying the described connection corresponding connecting object of socket;
Call subelement 307, for calling the described call back function connecting socket;
Send subelement 308, for the data that sends described client using described call back function by described connection
Socket is delivered to and described connecting object, so that after described connecting object is processed to described data, by the process obtaining
Result data returns to described client by described connection socket.
Discarding unit 401, for monitoring in socket default scheduling quota at one, connects socket failure when creating
When, abandon described monitoring socket.
Redistribute unit 402, for when monitoring socket default scheduling quota beyond one, if remaining to successfully create
Build connection socket, again for described monitoring socket allocation schedule quota.
Delete unit 403, for when described data processing finishes or data processing is abnormal, deleting described connection socket
Word.
Optionally, described deletion unit 403 includes:
Setting subelement 404, for deleting Preset Time to described connection socket setting;
Delete subelement 405, for when reaching deletion Preset Time, deleting described connection socket.
The foregoing is only presently preferred embodiments of the present invention, not in order to limit the present invention, all essences in the present invention
Within god and principle, any modification, equivalent substitution and improvement made etc., should be included within the scope of the present invention.
Claims (12)
1. a kind of network event processing method is it is characterised in that methods described includes:
When being called by protocol stack, judge to monitor the state whether socket is hyperlink request, described monitoring socket is used
In the linking request monitoring at least one client that port associated with it is received;
Distribute default scheduling quota to the monitoring socket of the state of hyperlink request, described default scheduling quota is to its institute
The operating time monitoring the data processing request of at least one client that socket is monitored belonging to;
One monitor socket default scheduling quota in, often receive a client data processing request when, create
With the connection socket of described client communication, individually create a connection socket with client communication for each client
Word, one is connected socket and is communicated with a client;
Create and pass through the described connecting object connecting socket communication with client;
The data that described client is sent is delivered to described connecting object by described connection socket, so that described connection is right
After described data is processed, the result obtaining data is returned to described client by described connection socket
End.
2. method according to claim 1 is it is characterised in that methods described also includes:
Monitor in socket default scheduling quota at one, when establishment connects socket failure, abandon described monitoring and be socketed
Word.
3. method according to claim 1 is it is characterised in that methods described also includes:
When monitoring socket default scheduling quota beyond one, if remaining to successfully create connection socket, again for institute
State monitoring socket allocation schedule quota.
4. method according to claim 1 is it is characterised in that the described data sending described client passes through described company
Connect socket and be delivered to described connecting object and include:
The identification described connection corresponding connecting object of socket;
Call the described call back function connecting socket;
Using described call back function, the data that described client sends is delivered to described connection by described connection socket right
As.
5. the method according to claim 1-4 any one is it is characterised in that methods described also includes:
When described data processing finishes or data processing is abnormal, delete described connection socket.
6. method according to claim 5 is it is characterised in that the described socket that connects of described deletion includes:
Delete Preset Time to described connection socket setting;
When reaching deletion Preset Time, delete described connection socket.
7. a kind of network event processing meanss are it is characterised in that described device includes:
Judging unit, for when being called by protocol stack, judging to monitor the state whether socket is hyperlink request, described
Monitor socket to be used for monitoring the linking request of at least one client that port associated with it is received;
Allocation unit, the monitoring socket for the state to hyperlink request distributes default scheduling quota, described default tune
Degree quota is the operating time of the data processing request monitoring at least one client that socket is monitored belonging to it;
First creating unit, for monitoring in socket default scheduling quota at one, often receives the number of a client
When asking according to process, create the connection socket with described client communication, for each client individually establishment one and visitor
The connection socket of family end communication, one is connected socket and is communicated with a client;
Second creating unit, passes through the described connecting object connecting socket communication for creating with client;
Processing unit, the data for sending described client is delivered to described connecting object by described connection socket,
So that after described connecting object is processed to described data, the result obtaining data is returned by described connection socket
Return to described client.
8. device according to claim 7 is it is characterised in that described device also includes:
Discarding unit, for monitoring in socket default scheduling quota at one, when creating connection socket failure, abandons
Described monitoring socket.
9. device according to claim 7 is it is characterised in that described device also includes:
Redistribute unit, for when monitoring socket default scheduling quota beyond one, if remaining to successfully create connection
Socket, then be described monitoring socket allocation schedule quota again.
10. device according to claim 7 is it is characterised in that described processing unit includes:
Identification subelement, for identifying the described connection corresponding connecting object of socket;
Call subelement, for calling the described call back function connecting socket;
Send subelement, pass for the data that described client sends being passed through described connection socket using described call back function
It is delivered to and described connecting object, so that after described connecting object is processed to described data, by the result obtaining data
Described client is returned to by described connection socket.
11. devices according to claim 7-10 any one are it is characterised in that described device also includes:
Delete unit, for when described data processing finishes or data processing is abnormal, deleting described connection socket.
12. devices according to claim 11 are it is characterised in that described deletion unit includes:
Setting subelement, for deleting Preset Time to described connection socket setting;
Delete subelement, for when reaching deletion Preset Time, deleting described connection socket.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201310446725.9A CN103501245B (en) | 2013-09-26 | 2013-09-26 | Network-event processing method and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201310446725.9A CN103501245B (en) | 2013-09-26 | 2013-09-26 | Network-event processing method and device |
Publications (2)
Publication Number | Publication Date |
---|---|
CN103501245A CN103501245A (en) | 2014-01-08 |
CN103501245B true CN103501245B (en) | 2017-02-08 |
Family
ID=49866420
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201310446725.9A Active CN103501245B (en) | 2013-09-26 | 2013-09-26 | Network-event processing method and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN103501245B (en) |
Families Citing this family (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106790022B (en) * | 2016-12-14 | 2019-06-18 | 福建天泉教育科技有限公司 | Communication means and its system based on more inquiry threads |
CN111061474B (en) * | 2018-10-16 | 2024-04-26 | 深圳市茁壮网络股份有限公司 | Lamda programming device and data processing method thereof |
CN115917519B (en) | 2021-07-30 | 2023-09-08 | 株式会社软技 | Recording medium storing information processing program, information processing apparatus, and information processing method |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1553649A (en) * | 2003-06-08 | 2004-12-08 | 华为技术有限公司 | Realizing method for long-range maintenance |
CN1747407A (en) * | 2004-07-09 | 2006-03-15 | 阿尔卡特公司 | Nms with multi-server events processing |
CN101202704A (en) * | 2007-09-07 | 2008-06-18 | 深圳市同洲电子股份有限公司 | Method and system for transmitting data |
CN101982955A (en) * | 2010-11-19 | 2011-03-02 | 深圳华大基因科技有限公司 | High-performance file transmission system and method thereof |
CN103164256A (en) * | 2011-12-08 | 2013-06-19 | 深圳市快播科技有限公司 | Processing method and system capable of achieving one machine supporting high concurrency |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2011096307A1 (en) * | 2010-02-03 | 2011-08-11 | 日本電気株式会社 | Proxy device and operation method thereof |
-
2013
- 2013-09-26 CN CN201310446725.9A patent/CN103501245B/en active Active
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1553649A (en) * | 2003-06-08 | 2004-12-08 | 华为技术有限公司 | Realizing method for long-range maintenance |
CN1747407A (en) * | 2004-07-09 | 2006-03-15 | 阿尔卡特公司 | Nms with multi-server events processing |
CN101202704A (en) * | 2007-09-07 | 2008-06-18 | 深圳市同洲电子股份有限公司 | Method and system for transmitting data |
CN101982955A (en) * | 2010-11-19 | 2011-03-02 | 深圳华大基因科技有限公司 | High-performance file transmission system and method thereof |
CN103164256A (en) * | 2011-12-08 | 2013-06-19 | 深圳市快播科技有限公司 | Processing method and system capable of achieving one machine supporting high concurrency |
Also Published As
Publication number | Publication date |
---|---|
CN103501245A (en) | 2014-01-08 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN106294472B (en) | A kind of querying method and device of Hadoop database HBase | |
CN108270732B (en) | A kind of Streaming Media processing method and system | |
US6848107B1 (en) | Message control apparatus | |
CN103501245B (en) | Network-event processing method and device | |
EP2378721A1 (en) | Bandwidth allocation method and routing apparatus | |
CN101951411A (en) | Cloud scheduling system and method and multistage cloud scheduling system | |
CN106681840A (en) | Tasking scheduling method and device for cloud operating system | |
CN101009649A (en) | Queue management in a network processor | |
CN102970244A (en) | Network message processing method of multi-CPU (Central Processing Unit) inter-core load balance | |
CN109491895A (en) | Server stress test method and device | |
CN102075246A (en) | Method, system and optical line terminal for obtaining malfunction information of optical network unit | |
CN109947581A (en) | The data transferring method of high concurrent and data transferring method for interchanger | |
CN103544098B (en) | A kind of method and apparatus of pressure test | |
JP2013026986A (en) | Packet transmission device, memory control circuit, and packet transmission method | |
CN102761545B (en) | Service processing method, service processor and service processing system | |
CN107454208A (en) | A kind of is the method that network address is distributed from node device | |
CN100396158C (en) | Method for transmitting point-to-point control channel message | |
CN109710435A (en) | A kind of message delivery method based on the more message queues of support | |
CN113055493B (en) | Data packet processing method, device, system, scheduling device and storage medium | |
CN107704421A (en) | A kind of polycaryon processor and message processing method | |
CN109639795B (en) | Service management method and device based on AcitveMQ message queue | |
CN101800663A (en) | Interface buffering method and system | |
US6865624B2 (en) | Method and apparatus for processing calls on a multiprocessor communication system | |
CN108781215A (en) | Network service implementing method, service controller and communication system | |
CN111130968A (en) | Method and terminal for solving Modbus bus communication packet sticking |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
C14 | Grant of patent or utility model | ||
GR01 | Patent grant | ||
CP02 | Change in the address of a patent holder |
Address after: 100086 11, 1101, 3 building, 2 South Road, Haidian District Academy of Sciences, Beijing. Patentee after: Internet Information Service Co., Ltd of Beijing Sohu Address before: 100084 Beijing Haidian District Zhongguancun East Road 1 hospital 9 building Sohu cyber building 15 Floor Patentee before: Internet Information Service Co., Ltd of Beijing Sohu |
|
CP02 | Change in the address of a patent holder |