Changeset 738


Ignore:
Timestamp:
12/6/2008 3:34:58 AM (5 years ago)
Author:
lowjoel
Message:

Include the User SID when creating a server instance so that multi-user scenarios are taken care of.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eraser6/Manager/RemoteExecutor.cs

    r737 r738  
    9090        /// Our Remote Server name, prevent collisions! 
    9191        /// </summary> 
    92         public const string ServerName = "Eraser-FB6C5A7D-E47F-475f-ABA4-58F4D24BB67E-RemoteExecutor"; 
     92        public static readonly string ServerName = 
     93            "Eraser-FB6C5A7D-E47F-475f-ABA4-58F4D24BB67E-RemoteExecutor-" + 
     94            System.Security.Principal.WindowsIdentity.GetCurrent().User.ToString(); 
    9395 
    9496        /// <summary> 
     
    100102        /// Our pipe instance which handles connections. 
    101103        /// </summary> 
    102         private NamedPipeServerStream server = 
    103             new NamedPipeServerStream(ServerName, PipeDirection.InOut, 4, 
     104        private NamedPipeServerStream server; 
     105 
     106        /// <summary> 
     107        /// Constructor. 
     108        /// </summary> 
     109        public RemoteExecutorServer() 
     110        { 
     111            server = new NamedPipeServerStream(ServerName, PipeDirection.InOut, 4, 
    104112                PipeTransmissionMode.Byte, PipeOptions.Asynchronous); 
    105113 
    106         /// <summary> 
    107         /// Constructor. 
    108         /// </summary> 
    109         public RemoteExecutorServer() 
    110         { 
    111114            thread = new Thread(Main); 
    112115            thread.Start(); 
    113  
    114116            Thread.Sleep(0); 
    115117        } 
     
    292294    public class RemoteExecutorClient : Executor 
    293295    { 
    294         private NamedPipeClientStream client = 
    295             new NamedPipeClientStream(".", RemoteExecutorServer.ServerName, 
     296        private NamedPipeClientStream client; 
     297 
     298        public RemoteExecutorClient() 
     299        { 
     300            client = new NamedPipeClientStream(".", RemoteExecutorServer.ServerName, 
    296301                PipeDirection.InOut); 
    297  
    298         public RemoteExecutorClient() 
    299         { 
    300302        } 
    301303 
Note: See TracChangeset for help on using the changeset viewer.