Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 99618 Details for
Bug 165409
IPv6 Support
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
Org.eclipse.hyades.execution - IPv6 Patch
org.eclipse.hyades.execution-ipv6.patch (text/plain), 8.48 KB, created by
Jonathan West
on 2008-05-10 16:05:48 EDT
(
hide
)
Description:
Org.eclipse.hyades.execution - IPv6 Patch
Filename:
MIME Type:
Creator:
Jonathan West
Created:
2008-05-10 16:05:48 EDT
Size:
8.48 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.hyades.execution >Index: src-core/org/eclipse/hyades/internal/execution/core/file/dynamic/DetermineServerReachCommand.java >=================================================================== >RCS file: /cvsroot/tptp/platform/org.eclipse.hyades.execution/src-core/org/eclipse/hyades/internal/execution/core/file/dynamic/DetermineServerReachCommand.java,v >retrieving revision 1.3 >diff -u -r1.3 DetermineServerReachCommand.java >--- src-core/org/eclipse/hyades/internal/execution/core/file/dynamic/DetermineServerReachCommand.java 3 Aug 2006 13:48:47 -0000 1.3 >+++ src-core/org/eclipse/hyades/internal/execution/core/file/dynamic/DetermineServerReachCommand.java 10 May 2008 19:32:33 -0000 >@@ -14,7 +14,7 @@ > > import java.io.IOException; > import java.net.InetSocketAddress; >-import java.nio.channels.SocketChannel; >+import java.net.Socket; > > import org.eclipse.hyades.internal.execution.core.file.socket.ISocketChannel; > >@@ -111,11 +111,13 @@ > && DetermineServerReachCommand.this.port >= 0) { > > try { >- SocketChannel sc = SocketChannel.open(new InetSocketAddress( >- DetermineServerReachCommand.this.host, >- DetermineServerReachCommand.this.port)); >+ >+ // This was changed from NIO to IO, because NIO doesn't support IPv6 at the moment. >+ Socket s = new Socket(DetermineServerReachCommand.this.host, >+ DetermineServerReachCommand.this.port); >+ > DetermineServerReachCommand.this.isHostReachable = true; >- sc.close(); /* bugzilla_152351: Socket should be closed on a successful connection */ >+ s.close(); /* bugzilla_152351: Socket should be closed on a successful connection */ > } catch (Throwable t) { > > /* >Index: src-local/org/eclipse/hyades/internal/execution/file/FileServerExtended.java >=================================================================== >RCS file: /cvsroot/tptp/platform/org.eclipse.hyades.execution/src-local/org/eclipse/hyades/internal/execution/file/FileServerExtended.java,v >retrieving revision 1.19 >diff -u -r1.19 FileServerExtended.java >--- src-local/org/eclipse/hyades/internal/execution/file/FileServerExtended.java 21 Mar 2008 12:52:40 -0000 1.19 >+++ src-local/org/eclipse/hyades/internal/execution/file/FileServerExtended.java 10 May 2008 19:32:34 -0000 >@@ -15,6 +15,8 @@ > import java.io.IOException; > import java.net.BindException; > import java.net.InetSocketAddress; >+import java.net.ServerSocket; >+import java.net.Socket; > import java.nio.channels.ServerSocketChannel; > import java.nio.channels.SocketChannel; > >@@ -67,7 +69,10 @@ > * in typical use via the agent controller it is a singleton in practice, > * every instance must have its own unique port to accept connections on > */ >- private ServerSocketChannel serverSocket; >+// private ServerSocketChannel serverSocketChannel; >+ >+ private ServerSocket serverSocket; >+ > > /** > * The file server status >@@ -102,8 +107,12 @@ > */ > private void cleanup() { > try { >+ > this.serverSocket.close(); >- this.serverSocket = null; >+ serverSocket = null; >+ >+// this.serverSocketChannel.close(); >+// this.serverSocketChannel = null; > this.parameters = null; > } catch (IOException e) { > // >@@ -209,16 +218,7 @@ > // Continue to hold lock until initialized, then notify waiters > synchronized (this) { > >- // Establish file server using a java.nio server channel >- this.serverSocket = ServerSocketChannel.open(); >- this.serverSocket.configureBlocking(true); >- >- // Set server socket timeout and bind to port >- this.serverSocket.socket().setSoTimeout(DEFAULT_SOCKET_TIMEOUT); >- this.serverSocket.socket().bind(new InetSocketAddress(this.getPort())); >- >- // Store the file server port to be used for the file server >- FileServer.setServerPort(this.serverSocket.socket().getLocalPort()); >+ initServerSocket(); > > // Change state to initialized and notify any waiters > this.initStatus = FileServiceConstants.RA_FS_INITIALIZED; >@@ -240,19 +240,18 @@ > while (!this.shutdown) { > > // Output debug output >- FileSystemServices.println(NLS.bind(LocalResourceBundle.FileServerExtended_EXTENDED_FILE_SERVER_LISTENING_, String.valueOf(this.getPort())), >- this); >+ FileSystemServices.println(NLS.bind(LocalResourceBundle.FileServerExtended_EXTENDED_FILE_SERVER_LISTENING_, String.valueOf(this.getPort())), this); > > // Block until connection is requested on known port >- SocketChannel clientChannel = this.serverSocket.accept(); >+ Socket s = this.serverSocket.accept(); > > // Set socket timeout to avoid blocking forever >- clientChannel.socket().setSoTimeout(DEFAULT_SOCKET_TIMEOUT); >- clientChannel.socket().setTcpNoDelay(true); >+ s.setSoTimeout(DEFAULT_SOCKET_TIMEOUT); >+ s.setTcpNoDelay(true); > > // Take newly connected socket to client and send to handler > IConnectionHandler handler = (IConnectionHandler) this.parameters.getConnectionHandler(); >- handler.connectionAccepted(SocketChannelFactory.getInstance().create(clientChannel)); >+ handler.connectionAccepted(SocketChannelFactory.getInstance().create(s)); > > } > >@@ -287,9 +286,30 @@ > > // Clean-up resources appropriately > this.cleanup(); >- >+ > } >- > } >+ >+ private void initServerSocket() throws IOException { >+ >+ this.serverSocket = new ServerSocket(this.getPort()); >+ >+ FileServer.setServerPort(this.serverSocket.getLocalPort()); >+ } >+ >+// private void oldInitIpv4SocketChannel() throws IOException { >+// >+// // Establish file server using a java.nio server channel >+// this.serverSocketChannel = ServerSocketChannel.open(); >+// this.serverSocketChannel.configureBlocking(true); >+// >+// // Set server socket timeout and bind to port >+// this.serverSocketChannel.socket().setSoTimeout(DEFAULT_SOCKET_TIMEOUT); >+// this.serverSocketChannel.socket().bind(new InetSocketAddress(this.getPort())); >+// >+// // Store the file server port to be used for the file server >+// FileServer.setServerPort(this.serverSocketChannel.socket().getLocalPort()); >+// >+// } > > } >\ No newline at end of file >Index: src-core/org/eclipse/hyades/internal/execution/core/file/socket/SocketChannelFactory.java >=================================================================== >RCS file: /cvsroot/tptp/platform/org.eclipse.hyades.execution/src-core/org/eclipse/hyades/internal/execution/core/file/socket/SocketChannelFactory.java,v >retrieving revision 1.5 >diff -u -r1.5 SocketChannelFactory.java >--- src-core/org/eclipse/hyades/internal/execution/core/file/socket/SocketChannelFactory.java 30 Oct 2006 18:25:55 -0000 1.5 >+++ src-core/org/eclipse/hyades/internal/execution/core/file/socket/SocketChannelFactory.java 10 May 2008 19:32:33 -0000 >@@ -68,6 +68,18 @@ > */ > public ISocketChannel create(InetSocketAddress address, int timeout) > throws IOException { >+ >+ if(address.getAddress().getAddress().length == 16) { >+ Socket s = new Socket(address.getAddress(), address.getPort()); >+ >+ s.setSoTimeout(timeout); >+ s.setTcpNoDelay(true); >+ s.setReuseAddress(true); >+ >+ return new SocketChannel(s); >+ >+ } >+ > java.nio.channels.SocketChannel socketChannel = java.nio.channels.SocketChannel > .open(); > socketChannel.configureBlocking(true); >Index: src-local/org/eclipse/hyades/internal/execution/local/common/Console.java >=================================================================== >RCS file: /cvsroot/tptp/platform/org.eclipse.hyades.execution/src-local/org/eclipse/hyades/internal/execution/local/common/Console.java,v >retrieving revision 1.10 >diff -u -r1.10 Console.java >--- src-local/org/eclipse/hyades/internal/execution/local/common/Console.java 14 Apr 2008 21:29:04 -0000 1.10 >+++ src-local/org/eclipse/hyades/internal/execution/local/common/Console.java 10 May 2008 19:32:34 -0000 >@@ -211,8 +211,17 @@ > try { > IFileManagerExtended fileManager = FileManagerFactory.getInstance() > .create(this._node.getConnection()); >- serverCanReach = fileManager.determineServerReach(localHost >- .getHostAddress(), (int) this._port); >+ >+ String hostname = null; >+ try { >+ hostname = InetAddress.getLocalHost().getCanonicalHostName(); >+ } catch (UnknownHostException e) { } >+ >+ if(hostname == null) { >+ hostname = localHost.getHostAddress(); >+ } >+ >+ serverCanReach = fileManager.determineServerReach(hostname, (int) this._port); > } catch (ServerNotAvailableException e) { > e.printStackTrace(); > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 165409
:
80048
|
91219
|
91220
|
92067
|
96037
|
96378
|
96379
| 99618 |
99619
|
99622
|
99735