Changeset 783
- Timestamp:
- 12/11/2008 6:51:50 AM (4 years ago)
- File:
-
- 1 edited
-
branches/eraser6/Manager/RemoteExecutor.cs (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/eraser6/Manager/RemoteExecutor.cs
r753 r783 22 22 23 23 using System; 24 using System.Text; 24 25 using System.IO; 25 using System.Text;26 26 using System.IO.Pipes; 27 27 using System.Threading; … … 29 29 30 30 using System.Runtime.Serialization; 31 using System.Runtime.Remoting.Messaging;32 31 using System.Runtime.Serialization.Formatters.Binary; 33 32 … … 128 127 EndWaitForConnection, server); 129 128 130 //Execute the handler if the server was connected. 131 if (asyncWait.AsyncWaitHandle.WaitOne()) 132 ThreadPool.QueueUserWorkItem(ProcessConnection, server); 129 //Wait for a connection before moving on to create another listening server 130 asyncWait.AsyncWaitHandle.WaitOne(); 133 131 } 134 132 } … … 141 139 private void EndWaitForConnection(IAsyncResult result) 142 140 { 143 NamedPipeServerStream server = (NamedPipeServerStream)result.AsyncState; 144 server.WaitForConnection(); 145 server.EndWaitForConnection(result); 146 } 147 148 /// <summary> 149 /// Handles a new connection from the client. 150 /// </summary> 151 /// <param name="param">The connected NamedPipeServerStream instance.</param> 152 private void ProcessConnection(object param) 153 { 154 //Get the Server instance. 155 using (NamedPipeServerStream server = (NamedPipeServerStream)param) 141 using (NamedPipeServerStream server = (NamedPipeServerStream)result.AsyncState) 156 142 { 143 //We're done waiting for the connection 144 server.EndWaitForConnection(result); 145 157 146 //Read the request into the buffer. 158 147 RemoteRequest request = null; … … 291 280 default: 292 281 throw new FatalException("Unknown RemoteExecutorClient.Function"); 282 } 293 283 #endregion 294 }295 284 296 285 //Return the result of the invoked function, if any.
Note: See TracChangeset
for help on using the changeset viewer.
