summaryrefslogtreecommitdiff
path: root/code/spyglass/docs/server.html
blob: 1f5a12be92803d202749d50a3a95934863e249da (plain)
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
<!DOCTYPE html>

<html>
<head>
  <title>server.rb</title>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <meta name="viewport" content="width=device-width, target-densitydpi=160dpi, initial-scale=1.0; maximum-scale=1.0; user-scalable=0;">
  <link rel="stylesheet" media="all" href="docco.css" />
</head>
<body>
  <div id="container">
    <div id="background"></div>
    
      <ul id="jump_to">
        <li>
          <a class="large" href="javascript:void(0);">Jump To &hellip;</a>
          <a class="small" href="javascript:void(0);">+</a>
          <div id="jump_wrapper">
          <div id="jump_page">
            
              
              <a class="source" href="configurator.html">
                configurator.rb
              </a>
            
              
              <a class="source" href="logging.html">
                logging.rb
              </a>
            
              
              <a class="source" href="lookout.html">
                lookout.rb
              </a>
            
              
              <a class="source" href="master.html">
                master.rb
              </a>
            
              
              <a class="source" href="server.html">
                server.rb
              </a>
            
              
              <a class="source" href="worker.html">
                worker.rb
              </a>
            
          </div>
        </li>
      </ul>
    
    <ul class="sections">
        
          <li id="title">
              <div class="annotation">
                  <h1>server.rb</h1>
              </div>
          </li>
        
        
        
        <li id="section-1">
            <div class="annotation">
              
              <div class="pilwrap ">
                <a class="pilcrow" href="#section-1">&#182;</a>
              </div>
              
            </div>
            
            <div class="content"><div class='highlight'><pre><span class="class"><span class="keyword">module</span> <span class="title">Spyglass</span></span>

  <span class="class"><span class="keyword">class</span> <span class="title">Server</span></span>
    <span class="keyword">include</span> <span class="constant">Singleton</span>
    <span class="keyword">include</span> <span class="constant">Logging</span>

    <span class="function"><span class="keyword">def</span> <span class="title">start</span></span></pre></div></div>
            
        </li>
        
        
        <li id="section-2">
            <div class="annotation">
              
              <div class="pilwrap ">
                <a class="pilcrow" href="#section-2">&#182;</a>
              </div>
              <p>Opens the main listening socket for the server. Now the server is responsive to
incoming connections.</p>

            </div>
            
            <div class="content"><div class='highlight'><pre>      sock = <span class="constant">TCPServer</span>.open(<span class="constant">Config</span>.host, <span class="constant">Config</span>.port)
      out <span class="string">"Listening on port <span class="subst">#{<span class="constant">Config</span>.host}</span>:<span class="subst">#{<span class="constant">Config</span>.port}</span>"</span>

      <span class="constant">Lookout</span>.instance.start(sock)
    <span class="keyword">end</span>
  <span class="keyword">end</span>
<span class="keyword">end</span></pre></div></div>
            
        </li>
        
    </ul>
  </div>
</body>
</html>