Method and apparatus for polling multiple sockets with a single thread and handling events received at the sockets with a pool of threads
First Claim
1. A media streaming server configured to stream media to multiple clients, the media streaming server comprising:
- a set of server sockets, including;
for each of the multiple clients, a separate control socket configured to receive media stream command events from the respective client;
a single delivery socket configured to stream the media to all the multiple clients simultaneously; and
a single quality control socket configured to receive media quality information events from all the multiple clients;
a poller module configured to;
poll one or more sockets in the set of sockets; and
when an event is received at the polled socket, pass the event to a consumer object configured to handle the event;
a set of consumer object classes derived from a single abstract base class of consumer objects, wherein the set of consumer object classes includes;
a listener object class configured to listen for connection requests from new clients;
a connection object class configured to handle command events received at polled sockets coupled to the multiple clients; and
a receiver object class configured to process data received at a polled socket; and
a set of task objects derived from a single abstract base class of task objects, wherein the set of task objects includes;
a command task object configured to execute a command received as part of a command event; and
a receive data task object configured to read data received at the media streaming server.
2 Assignments
0 Petitions
Accused Products
Abstract
A method and apparatus are provided for handling events received at a media streaming server. Server sockets configured to receive events are divided into collections and registered with a polling object. Each collection shares a processor thread for detecting events. Each socket is associated with an event consumer object that is notified when an event is received at the socket. The event consumer objects invoke task objects to handle the events. Task objects are queued in a task queue and execute using a pool of processor threads. Event consumer objects are derived from an abstract base consumer class that defines a common interface. Subclasses of the base consumer class are configured for different types of events that may be received (e.g., connection requests, media streaming commands, media data, media stream quality reports). Specific event consumer objects are instantiated from the subclasses to provide implementations of the common interface.
63 Citations
13 Claims
-
1. A media streaming server configured to stream media to multiple clients, the media streaming server comprising:
-
a set of server sockets, including; for each of the multiple clients, a separate control socket configured to receive media stream command events from the respective client; a single delivery socket configured to stream the media to all the multiple clients simultaneously; and a single quality control socket configured to receive media quality information events from all the multiple clients; a poller module configured to; poll one or more sockets in the set of sockets; and when an event is received at the polled socket, pass the event to a consumer object configured to handle the event; a set of consumer object classes derived from a single abstract base class of consumer objects, wherein the set of consumer object classes includes; a listener object class configured to listen for connection requests from new clients; a connection object class configured to handle command events received at polled sockets coupled to the multiple clients; and a receiver object class configured to process data received at a polled socket; and a set of task objects derived from a single abstract base class of task objects, wherein the set of task objects includes; a command task object configured to execute a command received as part of a command event; and a receive data task object configured to read data received at the media streaming server. - View Dependent Claims (2, 3, 4, 5, 6, 7)
-
-
8. A method of handling an event received at a media server from one of multiple clients receiving streamed media from the media server, the method comprising:
-
(a) polling server sockets of the media server identified in one or more polltables, wherein one or more processor threads are dedicated to each said polltable for polling sockets identified in the polltable; (b) executing a first listener object configured to listen at a listener socket for connections from the clients; (c) adding the listener socket to one of the polltables; (d) in response to receipt of a first client connection at the listener socket; (1) waking a processor thread dedicated to the polltable that includes the listener socket; (2) identifying the first listener object as the object responsible for handling events received at the listener socket; and (3) creating a first control socket dedicated to receiving control commands from the first client connection; (e) executing a first connection object configured to accept control commands from client connections; (f) adding the first control socket to one of the polltables; (g) in response to receipt of a control command at the first control socket; (1) waking a processor thread dedicated to the polltable that includes the first control socket; (2) identifying the first connection object as the object responsible for handling events received at the first control socket; (3) creating a first control task object configured to handle the control command; and (4) executing the first control task object; (h) streaming the media to the multiple clients simultaneously through a single media delivery socket, and (i) receiving streaming quality information from the multiple clients at a single quality control socket. - View Dependent Claims (9, 10, 11, 12, 13)
-
Specification