<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff></diff>
      <filename>additionals/bin/socket</filename>
    </modified>
    <modified>
      <diff>@@ -82,9 +82,28 @@ endfunction
 &quot; only through g:RubyDebugger.send_command function
 function! s:send_message_to_debugger(message)
   if g:ruby_debugger_fast_sender
-    call system(s:runtime_dir . &quot;/bin/socket &quot; . s:hostname . &quot; 39768 '&quot; . a:message . &quot;'&quot;)
+    call system(s:runtime_dir . &quot;/bin/socket &quot; . s:hostname . &quot; &quot; . s:debugger_port . &quot; '&quot; . a:message . &quot;'&quot;)
   else
-    call system(&quot;ruby -e \&quot;require 'socket'; a = TCPSocket.open('&quot; . s:hostname . &quot;', 39768); a.puts('&quot; . a:message . &quot;'); a.close\&quot;&quot;)
+    let script =  &quot;ruby -e \&quot;require 'socket'; &quot;
+    let script .= &quot;attempts = 0; &quot;
+    let script .= &quot;begin; &quot;
+    let script .=   &quot;a = TCPSocket.open('&quot; . s:hostname . &quot;', &quot; . s:debugger_port . &quot;); &quot;
+    let script .=   &quot;a.puts('&quot; . a:message . &quot;'); &quot;
+    let script .=   &quot;a.close; &quot;
+    let script .= &quot;rescue Errno::ECONNREFUSED; &quot;
+    let script .=   &quot;attempts += 1; &quot;
+    let script .=   &quot;if attempts &lt; 400; &quot;
+    let script .=     &quot;sleep 0.05; &quot;
+    let script .=     &quot;retry; &quot;
+    let script .=   &quot;else; &quot;
+    let script .=     &quot;puts('&quot; . s:hostname . &quot;:&quot; . s:debugger_port . &quot; can not be opened'); &quot;
+    let script .=     &quot;exit; &quot;
+    let script .=   &quot;end; &quot;
+    let script .= &quot;end; \&quot;&quot;
+    let output = system(script)
+    if output =~ 'can not be opened'
+      call g:RubyDebugger.logger.put(&quot;Can't send a message to rdebug - port is not opened&quot;) 
+    endif
   endif
 endfunction
 </diff>
      <filename>ruby_debugger/common.vim</filename>
    </modified>
    <modified>
      <diff>@@ -29,21 +29,17 @@ function! s:Server.start(script) dict
   &quot; Start in background
   if has(&quot;win32&quot;) || has(&quot;win64&quot;)
     silent exe '! start ' . rdebug
-    sleep 2
     let debugger = 'ruby &quot;' . expand(self.runtime_dir . &quot;/bin/ruby_debugger.rb&quot;) . '&quot;' . debugger_parameters
     silent exe '! start ' . debugger
-    sleep 2
   else
     call system(rdebug . ' &gt; ' . self.output_file . ' &amp;')
-    sleep 2
     let debugger = 'ruby ' . expand(self.runtime_dir . &quot;/bin/ruby_debugger.rb&quot;) . debugger_parameters
     call system(debugger. ' &amp;')
-    sleep 2
   endif
 
   &quot; Set PIDs of processes
-  let self.rdebug_pid = self._get_pid(self.hostname, self.rdebug_port)
-  let self.debugger_pid = self._get_pid(self.hostname, self.debugger_port)
+  let self.rdebug_pid = self._get_pid(self.hostname, self.rdebug_port, 1)
+  let self.debugger_pid = self._get_pid(self.hostname, self.debugger_port, 1)
 
   call g:RubyDebugger.logger.put(&quot;Start debugger&quot;)
 endfunction  
@@ -60,15 +56,30 @@ endfunction
 
 &quot; Return 1 if processes with set PID exist.
 function! s:Server.is_running() dict
-  return (self._get_pid(self.hostname, self.rdebug_port) =~ '^\d\+$') &amp;&amp; (self._get_pid(self.hostname, self.debugger_port) =~ '^\d\+$')
+  return (self._get_pid(self.hostname, self.rdebug_port, 0) =~ '^\d\+$') &amp;&amp; (self._get_pid(self.hostname, self.debugger_port, 0) =~ '^\d\+$')
 endfunction
 
 
 &quot; ** Private methods
 
 
-&quot; Get PID of process, that listens given port on given host
-function! s:Server._get_pid(bind, port)
+&quot; Get PID of process, that listens given port on given host. If must_get_pid
+&quot; parameter is true, it will try to get PID for 20 seconds.
+function! s:Server._get_pid(bind, port, must_get_pid)
+  let attempt = 0
+  let pid = self._get_pid_attempt(a:bind, a:port)
+  while a:must_get_pid &amp;&amp; pid == &quot;&quot; &amp;&amp; attempt &lt; 2000
+    sleep 10m
+    let attempt += 1
+    let pid = self._get_pid_attempt(a:bind, a:port)
+  endwhile
+  return pid
+endfunction
+
+
+&quot; Just try to get PID of process and return empty string if it was
+&quot; unsuccessful
+function! s:Server._get_pid_attempt(bind, port)
   if has(&quot;win32&quot;) || has(&quot;win64&quot;)
     let netstat = system(&quot;netstat -anop tcp&quot;)
     let pid_match = matchlist(netstat, ':' . a:port . '\s.\{-}LISTENING\s\+\(\d\+\)')
@@ -85,7 +96,7 @@ endfunction
 
 &quot; Kill listener of given host/port
 function! s:Server._stop_server(bind, port) dict
-  let pid = self._get_pid(a:bind, a:port)
+  let pid = self._get_pid(a:bind, a:port, 0)
   if pid =~ '^\d\+$'
     call self._kill_process(pid)
   endif</diff>
      <filename>ruby_debugger/server.vim</filename>
    </modified>
    <modified>
      <diff>@@ -11,6 +11,8 @@
 #include &lt;stdlib.h&gt;
 #include &lt;unistd.h&gt;
 
+#include &lt;time.h&gt;
+
 extern int errno;
 
 int main(int argc, char **argv) {
@@ -49,8 +51,14 @@ int main(int argc, char **argv) {
   memcpy(&amp;socketaddr.sin_addr, hostaddr-&gt;h_addr, hostaddr-&gt;h_length);
 
   int rval;
-  rval = connect(sd, (struct sockaddr *) &amp;socketaddr, sizeof(socketaddr));
-  printf(&quot;%d\n&quot;, rval);
+  int attempts = 0;
+  struct timespec ts = { .tv_sec = 0, .tv_nsec = 50000000 };
+  do { 
+    rval = connect(sd, (struct sockaddr *) &amp;socketaddr, sizeof(socketaddr));
+    attempts += 1;
+    nanosleep(&amp;ts, NULL);
+  } while (rval == -1 &amp;&amp; attempts &lt; 400);
+    
   if (rval == -1) {
     perror(&quot;connect()&quot;);
     return(errno);</diff>
      <filename>socket.c</filename>
    </modified>
    <modified>
      <diff>@@ -23,8 +23,8 @@ function! s:Tests.server.test_should_stop_server(test)
   exe &quot;Rdebugger&quot;
   call g:RubyDebugger.server.stop()
   call g:TU.ok(!g:RubyDebugger.server.is_running(), &quot;Server should not be run&quot;, a:test)
-  call g:TU.equal(&quot;&quot;, s:Server._get_pid(s:hostname, s:rdebug_port), &quot;Process rdebug-ide should not exist&quot;, a:test)
-  call g:TU.equal(&quot;&quot;, s:Server._get_pid(s:hostname, s:debugger_port), &quot;Process debugger.rb should not exist&quot;, a:test)
+  call g:TU.equal(&quot;&quot;, s:Server._get_pid(s:hostname, s:rdebug_port, 0), &quot;Process rdebug-ide should not exist&quot;, a:test)
+  call g:TU.equal(&quot;&quot;, s:Server._get_pid(s:hostname, s:debugger_port, 0), &quot;Process debugger.rb should not exist&quot;, a:test)
   call g:TU.equal(&quot;&quot;, g:RubyDebugger.server.rdebug_pid, &quot;Pid of rdebug-ide should be nullified&quot;, a:test)
   call g:TU.equal(&quot;&quot;, g:RubyDebugger.server.debugger_pid, &quot;Pid of debugger.rb should be nullified&quot;, a:test)
 endfunction</diff>
      <filename>tests/server.vim</filename>
    </modified>
    <modified>
      <diff>@@ -1,68 +1,107 @@
 require 'socket'
 
-def create_directory(file)
-  dir = File.dirname(file)
-  Dir.mkdir(dir) unless File.exist?(dir) &amp;&amp; File.directory?(dir)
-  dir
-end
+class VimRubyDebugger
 
-def have_unclosed_tag(output)
-  start_match = output.match(/^&lt;([a-zA-Z0-9\-_]+)&gt;/)
-  if start_match
-    end_match = output.match(/&lt;\/#{start_match[1]}&gt;$/)
-    return end_match ? false : true
-  else
-    return false
+  def initialize(params)
+    @params = params
+    create_directory(@params[:messages_file])
+    @rdebug = wait_for_opened_socket(@params[:host], @params[:rdebug_port])
+    @vim_ruby_debugger = TCPServer.new(@params[:host], @params[:vim_ruby_debugger_port])
+    run
   end
-end
 
-def read_socket(response, debugger, output = &quot;&quot;)
-  if response &amp;&amp; response[0] &amp;&amp; response[0][0]
-    output += response[0][0].recv(10000)
-    if have_unclosed_tag(output)
-      # If rdebug-ide doesn't send full message, we should wait for rest parts too.
-      # We can understand that this is just part of message by matching unclosed tags
-      another_response = select([debugger], nil, nil)
-    else
-      # Sometimes by some reason rdebug-ide sends blank strings just after main message. 
-      # We need to remove these strings by receiving them 
-      another_response = select([debugger], nil, nil, 0.01)
+  private
+
+    def wait_for_opened_socket(host, port, &amp;block)
+      attempts = 0
+      begin
+        socket = TCPSocket.open(host, port)
+        yield if block_given?
+      rescue Errno::ECONNREFUSED =&gt; msg
+        attempts += 1
+        # If socket wasn't be opened for 20 seconds, exit
+        if attempts &lt; 400
+          sleep 0.05
+          retry
+        else
+          raise Errno::ECONNREFUSED, &quot;#{host}:#{port} wasn't be opened&quot;
+        end
+      end
+      socket
     end
-    if another_response &amp;&amp; another_response[0] &amp;&amp; another_response[0][0]
-      output = read_socket(another_response, debugger, output)
+
+
+    def create_directory(file)
+      dir = File.dirname(file)
+      Dir.mkdir(dir) unless File.exist?(dir) &amp;&amp; File.directory?(dir)
     end
-  end
-  output
-end
 
-server = TCPServer.new(ARGV[0], ARGV[2])
-debugger = TCPSocket.open(ARGV[0], ARGV[1])
-create_directory(ARGV[5])
 
-storage = []
+    def run
+      t1 = Thread.new do
+        while(session = @vim_ruby_debugger.accept)
+          input = session.gets
+          @rdebug.puts(input)
+        end
+      end
+      t2 = Thread.new do
+        loop do 
+          response = select([@rdebug], nil, nil)
+          output = read_socket(response, @rdebug)
+          File.open(@params[:messages_file], 'w') { |f| f.puts(output) }
+          command = &quot;:call RubyDebugger.receive_command()&quot;
+          starter = (@params[:os] == 'win' ? &quot;&lt;C-\\&gt;&quot; : &quot;&lt;C-\\\\&gt;&quot;)
+          system(&quot;#{@params[:vim_executable]} --servername #{@params[:vim_servername]} -u NONE -U NONE --remote-send \&quot;&quot; + starter + &quot;&lt;C-N&gt;#{command}&lt;CR&gt;\&quot;&quot;);
+        end
+      end
 
+      t1.join
+
+      @rdebug.puts('exit')
+      @rdebug.close
+      @vim_ruby_debugger.close
+    end
+
+
+    def read_socket(response, debugger, output = &quot;&quot;)
+      if response &amp;&amp; response[0] &amp;&amp; response[0][0]
+        output += response[0][0].recv(10000)
+        if have_unclosed_tag(output)
+          # If rdebug-ide doesn't send full message, we should wait for rest parts too.
+          # We can understand that this is just part of message by matching unclosed tags
+          another_response = select([debugger], nil, nil)
+        else
+          # Sometimes by some reason rdebug-ide sends blank strings just after main message. 
+          # We need to remove these strings by receiving them 
+          another_response = select([debugger], nil, nil, 0.01)
+        end
+        if another_response &amp;&amp; another_response[0] &amp;&amp; another_response[0][0]
+          output = read_socket(another_response, debugger, output)
+        end
+      end
+      output
+    end
+
+
+    def have_unclosed_tag(output)
+      start_match = output.match(/^&lt;([a-zA-Z0-9\-_]+)&gt;/)
+      if start_match
+        end_match = output.match(/&lt;\/#{start_match[1]}&gt;$/)
+        return end_match ? false : true
+      else
+        return false
+      end
+    end
 
-t1 = Thread.new do
-  while(session = server.accept)
-    input = session.gets
-    
-    debugger.puts(input)
-  end
-end
-t2 = Thread.new do
-  loop do 
-    response = select([debugger], nil, nil)
-    output = read_socket(response, debugger)
-    File.open(ARGV[5], 'w') { |f| f.puts(output) }
-    command = &quot;:call RubyDebugger.receive_command()&quot;
-    starter = (ARGV[6] == 'win' ? &quot;&lt;C-\\&gt;&quot; : &quot;&lt;C-\\\\&gt;&quot;)
-    system(&quot;#{ARGV[3]} --servername #{ARGV[3]} -u NONE -U NONE --remote-send \&quot;&quot; + starter + &quot;&lt;C-N&gt;#{command}&lt;CR&gt;\&quot;&quot;);
- end
 end
 
-t1.join
 
-debugger.puts('exit')
-debugger.close
-server.close
-puts &quot;End&quot;
+VimRubyDebugger.new(
+  :host =&gt; ARGV[0],
+  :rdebug_port =&gt; ARGV[1],
+  :vim_ruby_debugger_port =&gt; ARGV[2],
+  :vim_executable =&gt; ARGV[3],
+  :vim_servername =&gt; ARGV[4],
+  :messages_file =&gt; ARGV[5],
+  :os =&gt; ARGV[6]
+)</diff>
      <filename>vim/bin/ruby_debugger.rb</filename>
    </modified>
    <modified>
      <diff>@@ -139,9 +139,28 @@ endfunction
 &quot; only through g:RubyDebugger.send_command function
 function! s:send_message_to_debugger(message)
   if g:ruby_debugger_fast_sender
-    call system(s:runtime_dir . &quot;/bin/socket &quot; . s:hostname . &quot; 39768 '&quot; . a:message . &quot;'&quot;)
+    call system(s:runtime_dir . &quot;/bin/socket &quot; . s:hostname . &quot; &quot; . s:debugger_port . &quot; '&quot; . a:message . &quot;'&quot;)
   else
-    call system(&quot;ruby -e \&quot;require 'socket'; a = TCPSocket.open('&quot; . s:hostname . &quot;', 39768); a.puts('&quot; . a:message . &quot;'); a.close\&quot;&quot;)
+    let script =  &quot;ruby -e \&quot;require 'socket'; &quot;
+    let script .= &quot;attempts = 0; &quot;
+    let script .= &quot;begin; &quot;
+    let script .=   &quot;a = TCPSocket.open('&quot; . s:hostname . &quot;', &quot; . s:debugger_port . &quot;); &quot;
+    let script .=   &quot;a.puts('&quot; . a:message . &quot;'); &quot;
+    let script .=   &quot;a.close; &quot;
+    let script .= &quot;rescue Errno::ECONNREFUSED; &quot;
+    let script .=   &quot;attempts += 1; &quot;
+    let script .=   &quot;if attempts &lt; 400; &quot;
+    let script .=     &quot;sleep 0.05; &quot;
+    let script .=     &quot;retry; &quot;
+    let script .=   &quot;else; &quot;
+    let script .=     &quot;puts('&quot; . s:hostname . &quot;:&quot; . s:debugger_port . &quot; can not be opened'); &quot;
+    let script .=     &quot;exit; &quot;
+    let script .=   &quot;end; &quot;
+    let script .= &quot;end; \&quot;&quot;
+    let output = system(script)
+    if output =~ 'can not be opened'
+      call g:RubyDebugger.logger.put(&quot;Can't send a message to rdebug - port is not opened&quot;) 
+    endif
   endif
 endfunction
 
@@ -1345,21 +1364,17 @@ function! s:Server.start(script) dict
   &quot; Start in background
   if has(&quot;win32&quot;) || has(&quot;win64&quot;)
     silent exe '! start ' . rdebug
-    sleep 2
     let debugger = 'ruby &quot;' . expand(self.runtime_dir . &quot;/bin/ruby_debugger.rb&quot;) . '&quot;' . debugger_parameters
     silent exe '! start ' . debugger
-    sleep 2
   else
     call system(rdebug . ' &gt; ' . self.output_file . ' &amp;')
-    sleep 2
     let debugger = 'ruby ' . expand(self.runtime_dir . &quot;/bin/ruby_debugger.rb&quot;) . debugger_parameters
     call system(debugger. ' &amp;')
-    sleep 2
   endif
 
   &quot; Set PIDs of processes
-  let self.rdebug_pid = self._get_pid(self.hostname, self.rdebug_port)
-  let self.debugger_pid = self._get_pid(self.hostname, self.debugger_port)
+  let self.rdebug_pid = self._get_pid(self.hostname, self.rdebug_port, 1)
+  let self.debugger_pid = self._get_pid(self.hostname, self.debugger_port, 1)
 
   call g:RubyDebugger.logger.put(&quot;Start debugger&quot;)
 endfunction  
@@ -1376,15 +1391,30 @@ endfunction
 
 &quot; Return 1 if processes with set PID exist.
 function! s:Server.is_running() dict
-  return (self._get_pid(self.hostname, self.rdebug_port) =~ '^\d\+$') &amp;&amp; (self._get_pid(self.hostname, self.debugger_port) =~ '^\d\+$')
+  return (self._get_pid(self.hostname, self.rdebug_port, 0) =~ '^\d\+$') &amp;&amp; (self._get_pid(self.hostname, self.debugger_port, 0) =~ '^\d\+$')
 endfunction
 
 
 &quot; ** Private methods
 
 
-&quot; Get PID of process, that listens given port on given host
-function! s:Server._get_pid(bind, port)
+&quot; Get PID of process, that listens given port on given host. If must_get_pid
+&quot; parameter is true, it will try to get PID for 20 seconds.
+function! s:Server._get_pid(bind, port, must_get_pid)
+  let attempt = 0
+  let pid = self._get_pid_attempt(a:bind, a:port)
+  while a:must_get_pid &amp;&amp; pid == &quot;&quot; &amp;&amp; attempt &lt; 2000
+    sleep 10m
+    let attempt += 1
+    let pid = self._get_pid_attempt(a:bind, a:port)
+  endwhile
+  return pid
+endfunction
+
+
+&quot; Just try to get PID of process and return empty string if it was
+&quot; unsuccessful
+function! s:Server._get_pid_attempt(bind, port)
   if has(&quot;win32&quot;) || has(&quot;win64&quot;)
     let netstat = system(&quot;netstat -anop tcp&quot;)
     let pid_match = matchlist(netstat, ':' . a:port . '\s.\{-}LISTENING\s\+\(\d\+\)')
@@ -1401,7 +1431,7 @@ endfunction
 
 &quot; Kill listener of given host/port
 function! s:Server._stop_server(bind, port) dict
-  let pid = self._get_pid(a:bind, a:port)
+  let pid = self._get_pid(a:bind, a:port, 0)
   if pid =~ '^\d\+$'
     call self._kill_process(pid)
   endif</diff>
      <filename>vim/plugin/ruby_debugger.vim</filename>
    </modified>
    <modified>
      <diff>@@ -139,9 +139,28 @@ endfunction
 &quot; only through g:RubyDebugger.send_command function
 function! s:send_message_to_debugger(message)
   if g:ruby_debugger_fast_sender
-    call system(s:runtime_dir . &quot;/bin/socket &quot; . s:hostname . &quot; 39768 '&quot; . a:message . &quot;'&quot;)
+    call system(s:runtime_dir . &quot;/bin/socket &quot; . s:hostname . &quot; &quot; . s:debugger_port . &quot; '&quot; . a:message . &quot;'&quot;)
   else
-    call system(&quot;ruby -e \&quot;require 'socket'; a = TCPSocket.open('&quot; . s:hostname . &quot;', 39768); a.puts('&quot; . a:message . &quot;'); a.close\&quot;&quot;)
+    let script =  &quot;ruby -e \&quot;require 'socket'; &quot;
+    let script .= &quot;attempts = 0; &quot;
+    let script .= &quot;begin; &quot;
+    let script .=   &quot;a = TCPSocket.open('&quot; . s:hostname . &quot;', &quot; . s:debugger_port . &quot;); &quot;
+    let script .=   &quot;a.puts('&quot; . a:message . &quot;'); &quot;
+    let script .=   &quot;a.close; &quot;
+    let script .= &quot;rescue Errno::ECONNREFUSED; &quot;
+    let script .=   &quot;attempts += 1; &quot;
+    let script .=   &quot;if attempts &lt; 400; &quot;
+    let script .=     &quot;sleep 0.05; &quot;
+    let script .=     &quot;retry; &quot;
+    let script .=   &quot;else; &quot;
+    let script .=     &quot;puts('&quot; . s:hostname . &quot;:&quot; . s:debugger_port . &quot; can not be opened'); &quot;
+    let script .=     &quot;exit; &quot;
+    let script .=   &quot;end; &quot;
+    let script .= &quot;end; \&quot;&quot;
+    let output = system(script)
+    if output =~ 'can not be opened'
+      call g:RubyDebugger.logger.put(&quot;Can't send a message to rdebug - port is not opened&quot;) 
+    endif
   endif
 endfunction
 
@@ -1345,21 +1364,17 @@ function! s:Server.start(script) dict
   &quot; Start in background
   if has(&quot;win32&quot;) || has(&quot;win64&quot;)
     silent exe '! start ' . rdebug
-    sleep 2
     let debugger = 'ruby &quot;' . expand(self.runtime_dir . &quot;/bin/ruby_debugger.rb&quot;) . '&quot;' . debugger_parameters
     silent exe '! start ' . debugger
-    sleep 2
   else
     call system(rdebug . ' &gt; ' . self.output_file . ' &amp;')
-    sleep 2
     let debugger = 'ruby ' . expand(self.runtime_dir . &quot;/bin/ruby_debugger.rb&quot;) . debugger_parameters
     call system(debugger. ' &amp;')
-    sleep 2
   endif
 
   &quot; Set PIDs of processes
-  let self.rdebug_pid = self._get_pid(self.hostname, self.rdebug_port)
-  let self.debugger_pid = self._get_pid(self.hostname, self.debugger_port)
+  let self.rdebug_pid = self._get_pid(self.hostname, self.rdebug_port, 1)
+  let self.debugger_pid = self._get_pid(self.hostname, self.debugger_port, 1)
 
   call g:RubyDebugger.logger.put(&quot;Start debugger&quot;)
 endfunction  
@@ -1376,15 +1391,30 @@ endfunction
 
 &quot; Return 1 if processes with set PID exist.
 function! s:Server.is_running() dict
-  return (self._get_pid(self.hostname, self.rdebug_port) =~ '^\d\+$') &amp;&amp; (self._get_pid(self.hostname, self.debugger_port) =~ '^\d\+$')
+  return (self._get_pid(self.hostname, self.rdebug_port, 0) =~ '^\d\+$') &amp;&amp; (self._get_pid(self.hostname, self.debugger_port, 0) =~ '^\d\+$')
 endfunction
 
 
 &quot; ** Private methods
 
 
-&quot; Get PID of process, that listens given port on given host
-function! s:Server._get_pid(bind, port)
+&quot; Get PID of process, that listens given port on given host. If must_get_pid
+&quot; parameter is true, it will try to get PID for 20 seconds.
+function! s:Server._get_pid(bind, port, must_get_pid)
+  let attempt = 0
+  let pid = self._get_pid_attempt(a:bind, a:port)
+  while a:must_get_pid &amp;&amp; pid == &quot;&quot; &amp;&amp; attempt &lt; 2000
+    sleep 10m
+    let attempt += 1
+    let pid = self._get_pid_attempt(a:bind, a:port)
+  endwhile
+  return pid
+endfunction
+
+
+&quot; Just try to get PID of process and return empty string if it was
+&quot; unsuccessful
+function! s:Server._get_pid_attempt(bind, port)
   if has(&quot;win32&quot;) || has(&quot;win64&quot;)
     let netstat = system(&quot;netstat -anop tcp&quot;)
     let pid_match = matchlist(netstat, ':' . a:port . '\s.\{-}LISTENING\s\+\(\d\+\)')
@@ -1401,7 +1431,7 @@ endfunction
 
 &quot; Kill listener of given host/port
 function! s:Server._stop_server(bind, port) dict
-  let pid = self._get_pid(a:bind, a:port)
+  let pid = self._get_pid(a:bind, a:port, 0)
   if pid =~ '^\d\+$'
     call self._kill_process(pid)
   endif
@@ -1676,8 +1706,8 @@ function! s:Tests.server.test_should_stop_server(test)
   exe &quot;Rdebugger&quot;
   call g:RubyDebugger.server.stop()
   call g:TU.ok(!g:RubyDebugger.server.is_running(), &quot;Server should not be run&quot;, a:test)
-  call g:TU.equal(&quot;&quot;, s:Server._get_pid(s:hostname, s:rdebug_port), &quot;Process rdebug-ide should not exist&quot;, a:test)
-  call g:TU.equal(&quot;&quot;, s:Server._get_pid(s:hostname, s:debugger_port), &quot;Process debugger.rb should not exist&quot;, a:test)
+  call g:TU.equal(&quot;&quot;, s:Server._get_pid(s:hostname, s:rdebug_port, 0), &quot;Process rdebug-ide should not exist&quot;, a:test)
+  call g:TU.equal(&quot;&quot;, s:Server._get_pid(s:hostname, s:debugger_port, 0), &quot;Process debugger.rb should not exist&quot;, a:test)
   call g:TU.equal(&quot;&quot;, g:RubyDebugger.server.rdebug_pid, &quot;Pid of rdebug-ide should be nullified&quot;, a:test)
   call g:TU.equal(&quot;&quot;, g:RubyDebugger.server.debugger_pid, &quot;Pid of debugger.rb should be nullified&quot;, a:test)
 endfunction</diff>
      <filename>vim/plugin/ruby_debugger_test.vim</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>e50f6a8699aee1e43fb04b6317e2c6a12e838a46</id>
    </parent>
  </parents>
  <author>
    <name>Anton Astashov</name>
    <email>anton@localhost.(none)</email>
  </author>
  <url>http://github.com/astashov/vim-ruby-debugger/commit/3db814e6ba3e0d899f44731374874419c5a9a711</url>
  <id>3db814e6ba3e0d899f44731374874419c5a9a711</id>
  <committed-date>2009-05-21T19:22:15-07:00</committed-date>
  <authored-date>2009-05-21T19:22:15-07:00</authored-date>
  <message>Removed all stupid 'sleep 2'. Now all socket functions are just trying to connect for some time (20 seconds) every 50ms. It speeds up and stabilizing the debugger</message>
  <tree>0ef11c79cbd0ad3f4caa8a0504bf8c955d7dde1d</tree>
  <committer>
    <name>Anton Astashov</name>
    <email>anton@localhost.(none)</email>
  </committer>
</commit>
