- Timestamp:
- 07/16/13 23:31:35 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
java/main/src/main/java/com/framsticks/hosting/Server.java
r101 r102 37 37 protected ServerSocket acceptSocket; 38 38 protected Tree hosted; 39 protected final JoinableCollection<ClientAtServer> clients = new JoinableCollection<ClientAtServer>( );39 protected final JoinableCollection<ClientAtServer> clients = new JoinableCollection<ClientAtServer>(JoinableCollection.FinishPolicy.Never); 40 40 41 41 public static class Accept { … … 68 68 } 69 69 70 @Override71 protected void joinableInterrupt() {72 Dispatching.drop(acceptThread, this);73 Dispatching.drop(hosted, this);74 Dispatching.drop(clients, this);75 try {76 acceptSocket.close();77 } catch (IOException e) {78 log.debug("exception caught during socket closing: ", e);79 }80 finishJoinable();81 }82 70 83 71 /** … … 101 89 public void childChangedState(Joinable joinable, JoinableState state) { 102 90 proceedToState(state); 103 }104 105 @Override106 protected void joinableStart() {107 Dispatching.use(acceptThread, this);108 Dispatching.use(hosted, this);109 Dispatching.use(clients, this);110 try {111 acceptSocket = new ServerSocket();112 } catch (IOException e) {113 throw new FramsticksException().msg("failed to create server socket").cause(e);114 }115 tryBind(0);116 91 } 117 92 … … 175 150 } 176 151 152 153 @Override 154 protected void joinableStart() { 155 Dispatching.use(acceptThread, this); 156 Dispatching.use(hosted, this); 157 Dispatching.use(clients, this); 158 try { 159 acceptSocket = new ServerSocket(); 160 acceptSocket.setReuseAddress(true); 161 } catch (IOException e) { 162 throw new FramsticksException().msg("failed to create server socket").cause(e); 163 } 164 tryBind(0); 165 } 166 167 @Override 168 protected void joinableInterrupt() { 169 Dispatching.drop(acceptThread, this); 170 Dispatching.drop(hosted, this); 171 Dispatching.drop(clients, this); 172 173 try { 174 acceptSocket.close(); 175 } catch (IOException e) { 176 log.debug("exception caught during socket closing: ", e); 177 } 178 179 finishJoinable(); 180 } 181 177 182 @Override 178 183 protected void joinableFinish() {
Note: See TracChangeset
for help on using the changeset viewer.