~cyberlink-upnp-committers/cyberlink-upnp/domoware

« back to all changes in this revision

Viewing changes to cyberlink/upnp-stack/src/main/java/org/cybergarage/http/HTTPServer.java

  • Committer: upston
  • Date: 2009-10-26 11:30:08 UTC
  • Revision ID: upston@whrcsdp06844-20091026113008-ix67fqoj93sj2dqf
replace 1.8.0-SNAPSHOT with domoware 1.8.0 release. 
NOTE:
- These are not the same 1.8.0.
- Domoware was branched earlier than where this is branched from, so some of the changes may actually be reversions of fixes since the branch.
- If anyone fancies trying to find the correct branch point, given we cannot see domoware's SVN repo, then do go ahead.
- This commit does actually correspond with the domoware src available from Maven central.

Show diffs side-by-side

added added

removed removed

Lines of Context:
14
14
*               - Improved the HTTP server using multithreading.
15
15
*       08/27/04
16
16
*               - Changed accept() to set a default timeout, HTTP.DEFAULT_TIMEOUT, to the socket.
 
17
*       02/01/08
 
18
*               - added thread name with bind address and port (francesco)
 
19
*       22/01/08
 
20
*               - added synchronizaation to performRequestListener as it is shared by HTTPServerThread and the chain of 
 
21
*                 HTTPRequestListener(s) (francesco)
17
22
*       
18
23
******************************************************************/
19
24
 
49
54
        public final static String VERSION = "1.0";
50
55
 
51
56
        public final static int DEFAULT_PORT = 80;
52
 
        
 
57
 
53
58
        /**
54
59
         * Default timeout connection for HTTP comunication
55
60
         * @since 1.8
70
75
        public HTTPServer()
71
76
        {
72
77
                serverSock = null;
73
 
                
74
78
        }
75
79
 
76
80
        ////////////////////////////////////////////////
103
107
                return bindPort;
104
108
        }
105
109
        
106
 
        
107
 
        
108
110
        ////////////////////////////////////////////////
109
111
        //      open/close
110
112
        ////////////////////////////////////////////////
204
206
                httpRequestListenerList.remove(listener);
205
207
        }               
206
208
 
207
 
        public void performRequestListener(HTTPRequest httpReq)
 
209
        public synchronized void performRequestListener(HTTPRequest httpReq)
208
210
        {
209
211
                int listenerSize = httpRequestListenerList.size();
210
212
                for (int n=0; n<listenerSize; n++) {