public class

SocketTransportService

extends TransportService
java.lang.Object
   ↳ com.sun.jdi.connect.spi.TransportService
     ↳ com.sun.tools.jdi.SocketTransportService

Summary

Public Constructors
SocketTransportService()
No-arg constructor
Public Methods
Connection accept(TransportService.ListenKey listener, long acceptTimeout, long handshakeTimeout)
Accept a connection from a debuggee and handshake with it.
Connection attach(String address, long attachTimeout, long handshakeTimeout)
Attach to the specified address with optional attach and handshake timeout.
TransportService.Capabilities capabilities()
Return the capabilities of this transport service
String description()
Return localized description of this transport service
String name()
The name of this transport service
TransportService.ListenKey startListening()
Listen on the default address
TransportService.ListenKey startListening(String address)
Listen on the specified address
void stopListening(TransportService.ListenKey listener)
Stop the listener
String toString()
Returns a string representation of the object.
[Expand]
Inherited Methods
From class com.sun.jdi.connect.spi.TransportService
From class java.lang.Object

Public Constructors

public SocketTransportService ()

No-arg constructor

Public Methods

public Connection accept (TransportService.ListenKey listener, long acceptTimeout, long handshakeTimeout)

Accept a connection from a debuggee and handshake with it.

Parameters
listener A listen key obtained from a previous call to startListening(String) or startListening().
acceptTimeout if this transport service supports an accept timeout, and if acceptTimeout is positive then block for up to acceptTimeout milliseconds, more or less, while waiting for the target VM to connect. If the transport service does not support an accept timeout or if acceptTimeout is zero then block indefinitely for a target VM to connect.
handshakeTimeout If this transport service supports a handshake timeout, and if handshakeTimeout is positive, then it specifies the timeout, in milliseconds (more or less), to use when handshaking with the target VM. The exact usage of the timeout is specific to the transport service. A transport service may, for example, use the handshake timeout as the inter-character timeout while waiting for the JDWP-Handshake message from the target VM. Alternatively, a transport service may, for example, use the timeout as a timeout for the duration of the handshake exchange. If the transport service does not support a handshake timeout, of if handshakeTimeout is specified as zero then the handshake does not timeout if there isn't a response from the target VM.
Returns
  • The Connection representing the bi-directional communication channel to the target VM.
Throws
IOException

public Connection attach (String address, long attachTimeout, long handshakeTimeout)

Attach to the specified address with optional attach and handshake timeout.

Parameters
address The address of the target VM.
attachTimeout If this transport service supports an attach timeout, and if attachTimeout is positive, then it specifies the timeout, in milliseconds (more or less), to use when attaching to the target VM. If the transport service does not support an attach timeout, or if attachTimeout is specified as zero then attach without any timeout.
handshakeTimeout If this transport service supports a handshake timeout, and if handshakeTimeout is positive, then it specifies the timeout, in milliseconds (more or less), to use when handshaking with the target VM. The exact usage of the timeout are specific to the transport service. A transport service may, for example, use the handshake timeout as the inter-character timeout while waiting for the JDWP-Handshake message from the target VM. Alternatively, a transport service may, for example, use the handshakeTimeout as a timeout for the duration of the handshake exchange. If the transport service does not support a handshake timeout, or if handshakeTimeout is specified as zero then the handshake does not timeout if there isn't a response from the target VM.
Returns
  • The Connection representing the bi-directional communication channel to the target VM.
Throws
IOException

public TransportService.Capabilities capabilities ()

Return the capabilities of this transport service

Returns
  • the transport service capabilities

public String description ()

Return localized description of this transport service

Returns
  • The description of the transport service

public String name ()

The name of this transport service

Returns
  • The name of the transport service

public TransportService.ListenKey startListening ()

Listen on the default address

Returns
Throws
IOException

public TransportService.ListenKey startListening (String address)

Listen on the specified address

Parameters
address The address to start listening for connections, or null to listen on an address choosen by the transport service.
Returns
Throws
IOException

public void stopListening (TransportService.ListenKey listener)

Stop the listener

Parameters
listener The listen key obtained from a previous call to startListening(String) or startListening().
Throws
IOException

public String toString ()

Returns a string representation of the object. In general, the toString method returns a string that "textually represents" this object. The result should be a concise but informative representation that is easy for a person to read. It is recommended that all subclasses override this method.

The toString method for class Object returns a string consisting of the name of the class of which the object is an instance, the at-sign character `@', and the unsigned hexadecimal representation of the hash code of the object. In other words, this method returns a string equal to the value of:

 getClass().getName() + '@' + Integer.toHexString(hashCode())
 

Returns
  • a string representation of the object.