File: ServerMultiplexer.H

package info (click to toggle)
dxpc 3.9.2-1
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 1,140 kB
  • ctags: 1,253
  • sloc: cpp: 12,036; sh: 2,823; makefile: 78
file content (38 lines) | stat: -rw-r--r-- 980 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#ifndef ServerMultiplexer_H
# define ServerMultiplexer_H

# include <sys/types.h>
# ifndef __MINGW32__
#  include <sys/socket.h>
# endif
# include "Multiplexer.H"


class ServerMultiplexer:public Multiplexer
{
  public:
    ServerMultiplexer(int proxyFD, int xServerAddrFamily,
                      sockaddr * xServerAddr, unsigned int xServerAddrLength,
                      unsigned int statisticsLevel);
      virtual ~ServerMultiplexer();

  protected:
      virtual void createNewConnection(int fd);
    virtual int createNewConnectionFromProxy(int channelID);

    virtual int channelIDToFD(int channelID) const;
    virtual int fdToChannelID(int fd) const;
    virtual void cleanupChannelFDMapping(int channelFD);

    int fdToChannelIDMap_[MAX_CONNECTIONS];
    int channelIDToFDMap_[MAX_CONNECTIONS];

    int xServerAddrFamily_;
    sockaddr *xServerAddr_;
    unsigned int xServerAddrLength_;

    unsigned int statisticsLevel_;
};


#endif /* ServerMultiplexer_H */