Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
PojavLauncherTeam
GitHub Repository: PojavLauncherTeam/mobile
Path: blob/master/test/hotspot/jtreg/vmTestbase/nsk/share/jpda/IOPipe.java
41161 views
1
/*
2
* Copyright (c) 2001, 2021, Oracle and/or its affiliates. All rights reserved.
3
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4
*
5
* This code is free software; you can redistribute it and/or modify it
6
* under the terms of the GNU General Public License version 2 only, as
7
* published by the Free Software Foundation.
8
*
9
* This code is distributed in the hope that it will be useful, but WITHOUT
10
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12
* version 2 for more details (a copy is included in the LICENSE file that
13
* accompanied this code).
14
*
15
* You should have received a copy of the GNU General Public License version
16
* 2 along with this work; if not, write to the Free Software Foundation,
17
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18
*
19
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20
* or visit www.oracle.com if you need additional information or have any
21
* questions.
22
*/
23
24
package nsk.share.jpda;
25
26
import nsk.share.*;
27
28
/**
29
* This class implements communicational channel between
30
* debugger and debugee used for synchronization and data exchange.
31
* This channel is based on TCP/IP sockets and works in all
32
* modes (local, remote and manual). In a remote mode
33
* connection to <code>BindServer</code> is used for redirecting IOPipe messages.
34
* In all other modes direct TCP/IP coonnection between two VMs is used.
35
*
36
* @see BindServer
37
*/
38
public class IOPipe extends SocketIOPipe {
39
40
public static final byte PORTS_COUNT = 10;
41
public static final byte NO_PORTS = 0;
42
43
public static final String PIPE_LOG_PREFIX = "IOPipe> ";
44
45
private DebugeeProcess debugee;
46
47
/**
48
* Make <code>IOPipe</code> at debugee's side.
49
*
50
* @deprecated Use DebugeeArgumentHandler.createDebugeeIOPipe(Log) instead.
51
*
52
* @see DebugeeArgumentHandler#createDebugeeIOPipe(Log)
53
*/
54
@Deprecated
55
public IOPipe(DebugeeArgumentHandler argumentHandler, Log log) {
56
this(log, getTestHost(argumentHandler), argumentHandler.getPipePortNumber(),
57
(long)argumentHandler.getWaitTime() * 60 * 1000, false);
58
}
59
60
/**
61
* Make <code>IOPipe</code> at debugger's side
62
* with given <code>Debugee</code> mirror.
63
*
64
* @deprecated Use Debugee.createIOPipe() instead.
65
*/
66
@Deprecated
67
public IOPipe(DebugeeProcess debugee) {
68
this(debugee.getLog(),
69
debugee.getArgumentHandler().getDebugeeHost(),
70
debugee.getArgumentHandler().getPipePortNumber(),
71
(long)debugee.getArgumentHandler().getWaitTime() * 60 * 1000,
72
true);
73
74
this.debugee = debugee;
75
}
76
77
/**
78
* Make general <code>IOPipe</code> object with specified parameters.
79
*/
80
protected IOPipe(Log log, String host, int port, long timeout, boolean listening) {
81
super("IOPipe", log, PIPE_LOG_PREFIX, host, port, timeout, listening);
82
}
83
84
protected void connect() {
85
if (listening) {
86
setServerSocket(debugee.getPipeServerSocket());
87
setConnectingProcess(debugee.getProcess());
88
}
89
90
super.connect();
91
}
92
93
/**
94
* Get appropriate test host name relying on the provided argumnets.
95
*/
96
private static String getTestHost(DebugeeArgumentHandler argumentHandler) {
97
return argumentHandler.getTestHost();
98
}
99
100
} // IOPipe
101
102