Update of /cvsroot/pydev/org.python.pydev/src/org/python/pydev/editor/codecompletion
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24562/src/org/python/pydev/editor/codecompletion
Modified Files:
PythonShell.java
Log Message:
Index: PythonShell.java
===================================================================
RCS file: /cvsroot/pydev/org.python.pydev/src/org/python/pydev/editor/codecompletion/PythonShell.java,v
retrieving revision 1.17
retrieving revision 1.18
diff -C2 -d -r1.17 -r1.18
*** PythonShell.java 19 Oct 2004 14:41:55 -0000 1.17
--- PythonShell.java 20 Oct 2004 17:28:44 -0000 1.18
***************
*** 32,36 ****
private static final int DEFAULT_SLEEP_BETWEEN_ATTEMPTS = 500;
/**
! * Reference to a 'global python shell'
*/
private static Map shells = new HashMap();
--- 32,36 ----
private static final int DEFAULT_SLEEP_BETWEEN_ATTEMPTS = 500;
/**
! * Reference to 'global python shells'
*/
private static Map shells = new HashMap();
***************
*** 167,179 ****
sleepALittle(300);
while(!connected && attempts < 20){
attempts += 1;
try {
! socketToWrite = new Socket("127.0.0.1",pWrite); //we should write in this port
! serverSocket = new ServerSocket(pRead); //and read in this port
socketToRead = serverSocket.accept();
connected = true;
} catch (IOException e1) {
! PydevPlugin.log(IStatus.ERROR, "Attempt: "+attempts+" of 20 failed, trying again...", e1);
}
--- 167,186 ----
sleepALittle(300);
+ socketToWrite = null;
+ serverSocket = new ServerSocket(pRead); //read in this port
while(!connected && attempts < 20){
attempts += 1;
try {
! if(socketToWrite == null || socketToWrite.isConnected() == false){
! socketToWrite = new Socket("127.0.0.1",pWrite); //we should write in this port
! }
socketToRead = serverSocket.accept();
connected = true;
} catch (IOException e1) {
! if(socketToWrite != null && socketToWrite.isConnected() == true){
! PydevPlugin.log(IStatus.ERROR, "Attempt: "+attempts+" of 20 failed, trying again...(socketToWrite already binded)", e1);
! }else{
! PydevPlugin.log(IStatus.ERROR, "Attempt: "+attempts+" of 20 failed, trying again...", e1);
! }
}
|