/[svn]/linuxsampler/trunk/src/network/lscpserver.cpp
ViewVC logotype

Diff of /linuxsampler/trunk/src/network/lscpserver.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 210 by schoenebeck, Sat Jul 24 12:33:49 2004 UTC revision 211 by schoenebeck, Sun Jul 25 23:27:41 2004 UTC
# Line 61  LSCPServer::LSCPServer(Sampler* pSampler Line 61  LSCPServer::LSCPServer(Sampler* pSampler
61      LSCPEvent::RegisterEvent(LSCPEvent::event_misc, "MISCELLANEOUS");      LSCPEvent::RegisterEvent(LSCPEvent::event_misc, "MISCELLANEOUS");
62  }  }
63    
64    /**
65     * Blocks the calling thread until the LSCP Server is initialized and
66     * accepting socket connections, if the server is already initialized then
67     * this method will return immediately.
68     * @param TimeoutSeconds     - optional: max. wait time in seconds
69     *                             (default: 0s)
70     * @param TimeoutNanoSeconds - optional: max wait time in nano seconds
71     *                             (default: 0ns)
72     * @returns  0 on success, a value less than 0 if timeout exceeded
73     */
74    int LSCPServer::WaitUntilInitialized(long TimeoutSeconds, long TimeoutNanoSeconds) {
75        return Initialized.WaitAndUnlockIf(false, TimeoutSeconds, TimeoutNanoSeconds);
76    }
77    
78  int LSCPServer::Main() {  int LSCPServer::Main() {
79      int hSocket = socket(AF_INET, SOCK_STREAM, 0);      int hSocket = socket(AF_INET, SOCK_STREAM, 0);
80      if (hSocket < 0) {      if (hSocket < 0) {
# Line 81  int LSCPServer::Main() { Line 95  int LSCPServer::Main() {
95      }      }
96    
97      listen(hSocket, 1);      listen(hSocket, 1);
98      dmsg(1,("LSCPServer: Server running.\n")); // server running      Initialized.Set(true);
99    
100      // now wait for client connections and handle their requests      // now wait for client connections and handle their requests
101      sockaddr_in client;      sockaddr_in client;

Legend:
Removed from v.210  
changed lines
  Added in v.211

  ViewVC Help
Powered by ViewVC