ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/repos/Smersh/Daemon.cpp
(Generate patch)

Comparing Smersh/Daemon.cpp (file contents):
Revision 241 by Douglas Thrift, 2004-09-11T20:59:56-07:00 vs.
Revision 253 by Douglas Thrift, 2004-09-13T23:31:24-07:00

# Line 8 | Line 8
8  
9   string Daemon::crlf("\r\n");
10  
11 < void Daemon::serve(bool fork, Daemon* self)
11 > void Daemon::serve(Daemon* self)
12   {
13 <        api::TcpSocket server;
13 >        ext::StackReference<api::TcpSocket> server;
14  
15          server.SetAddress(api::InternetAddress(api::InternetAddress::Any, port));
16
17        if (fork)
18        {
19                switch (pid_t pid = ::fork())
20                {
21                case -1:
22                        cerr << program << ": fork()\n";
23
24                        exit(1);
25                case 0:
26                        break;
27                default:
28                        cout << pid << '\n';
29                        return;
30                }
31        }
32
16          server.Listen(50);
17  
18          while (true)
19          {
20 <                Client* client (new Client(server));
20 >                Client* client(new Client(server));
21                  api::Thread thread(etl::BindAll(&Daemon::handle, self, client));
22          }
23   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines