equal
deleted
inserted
replaced
231 |
231 |
232 /* |
232 /* |
233 * InputStream for the socket connection to get target VM |
233 * InputStream for the socket connection to get target VM |
234 */ |
234 */ |
235 private class SocketInputStream extends InputStream { |
235 private class SocketInputStream extends InputStream { |
236 int s; |
236 int s = -1; |
237 |
237 |
238 public SocketInputStream(int s) { |
238 public SocketInputStream(int s) { |
239 this.s = s; |
239 this.s = s; |
240 } |
240 } |
241 |
241 |
259 |
259 |
260 return VirtualMachineImpl.read(s, bs, off, len); |
260 return VirtualMachineImpl.read(s, bs, off, len); |
261 } |
261 } |
262 |
262 |
263 public void close() throws IOException { |
263 public void close() throws IOException { |
264 VirtualMachineImpl.close(s); |
264 synchronized (this) { |
|
265 if (s != -1) { |
|
266 VirtualMachineImpl.close(s); |
|
267 s = -1; |
|
268 } |
|
269 } |
265 } |
270 } |
266 } |
271 } |
267 |
272 |
268 // Return the socket file for the given process. |
273 // Return the socket file for the given process. |
269 private File findSocketFile(int pid, int ns_pid) { |
274 private File findSocketFile(int pid, int ns_pid) { |