~registry/scalestack/trunk

« back to all changes in this revision

Viewing changes to scalestack/network/listener.h

  • Committer: Eric Day
  • Date: 2010-12-04 17:17:34 UTC
  • mfrom: (56.1.9)
  • Revision ID: git-v1:9c392b034d652023a4b28ae2976aca128bb856c2
Merged Eric's branch with style updates, config file support, and other cleanup.

Show diffs side-by-side

added added

removed removed

Lines of Context:
26
26
namespace network
27
27
{
28
28
 
29
 
class stream_service;
 
29
class listener_service;
30
30
 
31
31
class SCALESTACK_API listener: public event::handler
32
32
{
35
35
  /**
36
36
   * Constructor, setup associated services.
37
37
   *
38
 
   * @param[in] handler_service Service this listener is associated with.
39
 
   * @param[in] stream_service Service this listener should add streams to
40
 
   *  when it accepts new streams.
 
38
   * @param[in] listener_service Service this listener is associated with.
41
39
   */
42
 
  listener(event::handler_service& handler_service,
43
 
           stream_service& stream_service);
 
40
  listener(listener_service& listener_service);
44
41
 
45
42
  virtual ~listener();
46
43
 
47
44
  /**
48
45
   * Bind and start listening on a socket.
49
46
   *
50
 
   * @param[in] address The address to bind and listen on.
 
47
   * @param[in] local The local address to bind and listen on.
51
48
   * @param[in] backlog Maximum length of backlog queue, passed to listen
52
49
   *  system call.
53
50
   */
54
 
  void listen(const struct addrinfo& address, int backlog);
 
51
  void listen(const struct addrinfo& local, int backlog);
55
52
 
56
53
  /**
57
54
   * This is called when a stream is ready to be accepted on the listening
72
69
  listener& operator=(const listener&);
73
70
 
74
71
  int _file_descriptor;
75
 
  stream_service& _stream_service;
 
72
  listener_service& _listener_service;
76
73
};
77
74
 
78
75
} /* namespace network */