kalvinC / vim

Automatically exported from code.google.com/p/vim
0 stars 0 forks source link

netbeans session not terminated on Windows after socket closed #107

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
VIM - Vi IMproved 7.3 (2010 Aug 15, compiled Apr 20 2012 21:18:56)
Included patches: 1-502

Steps to reproduce:
    * start the following netbeans.py server with python 3 (or adapt netbeans.py
      for python 2)
    * start a vim instance and issue the command ':nbstart'
    * after netbeans.py has terminated, the command
      ':echo has("netbeans_enabled")' still prints '1'
    * one must run first ':nbclose' to start a new netbeans session on this vim
      instance

The problem does not happen on linux.

===   netbeans.py   =======================================
import socket

# Start this script with python3, then run ":nbstart" in Vim.
HOST = ''
PORT = 3219
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR,
        s.getsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR) | 1)
s.bind((HOST, PORT))
s.listen(1)
conn, addr = s.accept()
print('Connected by', addr)
while 1:
    data = conn.recv(1024)
    # python2: msg = data
    msg = data.decode()
    print(msg)
    if 'startupDone' in msg:
        break
print('Closing.')
conn.close()
===========================================================

Original issue reported on code.google.com by xdeg...@gmail.com on 28 Jan 2013 at 5:50