Inheritance: IDisposable
コード例 #1
0
ファイル: MsysSocketTest.cs プロジェクト: dlech/SshAgentLib
 public void TestTestFile()
 {
     var path = Path.GetTempFileName();
       Assert.That(MsysSocket.TestFile(path), Is.False);
       File.Delete(path);
       using (var socket = new CygwinSocket(path)) {
     Assert.That(MsysSocket.TestFile(path), Is.False);
       }
       using (var socket = new MsysSocket(path)) {
     Assert.That(MsysSocket.TestFile(path), Is.True);
       }
 }
コード例 #2
0
 public void StopMsysSocket()
 {
     if (disposed)
     {
         throw new ObjectDisposedException("PagentAgent");
     }
     if (msysSocket == null)
     {
         return;
     }
     msysSocket.Dispose();
     msysSocket = null;
 }
コード例 #3
0
 /// <summary>
 /// Starts a msysgit style socket that can be used by the ssh program
 /// that comes with msysgit.
 /// </summary>
 /// <param name="path">The path to the socket file that will be created.</param>
 public void StartMsysSocket(string path)
 {
     if (disposed)
     {
         throw new ObjectDisposedException("PagentAgent");
     }
     if (msysSocket != null)
     {
         return;
     }
     // only overwrite a file if it looks like a MsysSocket file.
     // TODO: Might be good to test that there are not network sockets using
     // the port specified in this file.
     if (File.Exists(path) && MsysSocket.TestFile(path))
     {
         File.Delete(path);
     }
     msysSocket = new MsysSocket(path);
     msysSocket.ConnectionHandler = connectionHandler;
 }
コード例 #4
0
ファイル: PageantAgent.cs プロジェクト: dlech/SshAgentLib
 public void StopMsysSocket()
 {
     if (disposed)
     throw new ObjectDisposedException("PagentAgent");
       if (msysSocket == null)
     return;
       msysSocket.Dispose();
       msysSocket = null;
 }
コード例 #5
0
ファイル: PageantAgent.cs プロジェクト: dlech/SshAgentLib
 /// <summary>
 /// Starts a msysgit style socket that can be used by the ssh program
 /// that comes with msysgit.
 /// </summary>
 /// <param name="path">The path to the socket file that will be created.</param>
 public void StartMsysSocket(string path)
 {
     if (disposed) {
     throw new ObjectDisposedException("PagentAgent");
       }
       if (msysSocket != null) {
     return;
       }
       // only overwrite a file if it looks like a MsysSocket file.
       // TODO: Might be good to test that there are not network sockets using
       // the port specified in this file.
       if (File.Exists(path) && MsysSocket.TestFile(path)) {
     File.Delete(path);
       }
       msysSocket = new MsysSocket(path);
       msysSocket.ConnectionHandler = connectionHandler;
 }