Package org.mozilla.jss.nss
Class PR
java.lang.Object
org.mozilla.jss.nss.PR
This class provides static access to raw NSPS calls with the PR prefix,
and handles the usage of NativeProxy objects.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
Return value on failure from NSPR functions.static final int
Shut down both sides of the TCP connection.static final int
Shut down the receiving side of the TCP connection.static final int
Shut down the sending side of the TCP connection.static final int
Return value on success from NSPR functions. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic int
Close an existing PRFDProxy, clearing the pointer if successful.static int
Close an existing PRFDProxy with an option to clear the pointer.static int
Close
(SSLFDProxy fd) Close an existing SSLFDProxy.static String
ErrorToName
(int code) Get the constant name of the current PR error.private static byte[]
ErrorToNameNative
(int code) static int
GetError()
Get the value of the current PR error.static String
Get the error text of the current PR error.private static byte[]
private static int
private static int
private static int
private static int
private static int
static PRFDProxy
NewBufferPRFD
(BufferProxy read_buf, BufferProxy write_buf, byte[] peer_info) Create a new j_buffer backed PRFileDesc, mimicing a TCP socket with the specified peer_info.static PRFDProxy
Open a new TCP Socket and create a new PRFDProxy for that socket.static PRFDProxy
Open the file at name (with the specified flags and mode) and create a new PRFDProxy (to a NSPR PRFileDesc *) for that file.static byte[]
Read up to amount bytes from a PRFDProxy.static byte[]
Recv up to amount bytes from a PRFDProxy, given the specified receive flags and timeout value.static int
Send the specified bytes via the PRFDProxy, given the specified send flags and timeout value.static int
Shutdown an existing PRFDProxy.static int
Write the specified bytes to the PRFDProxy.
-
Field Details
-
SHUTDOWN_RCV
public static final int SHUTDOWN_RCVShut down the receiving side of the TCP connection. See also: Shutdown -
SHUTDOWN_SEND
public static final int SHUTDOWN_SENDShut down the sending side of the TCP connection. See also: Shutdown -
SHUTDOWN_BOTH
public static final int SHUTDOWN_BOTHShut down both sides of the TCP connection. See also: Shutdown -
SUCCESS
public static final int SUCCESSReturn value on success from NSPR functions. See also: PR_SUCCESS in /usr/include/nspr4/prtypes.h -
FAILURE
public static final int FAILUREReturn value on failure from NSPR functions. See also: PR_FAILURE in /usr/include/nspr4/prtypes.h
-
-
Constructor Details
-
PR
public PR()
-
-
Method Details
-
Open
Open the file at name (with the specified flags and mode) and create a new PRFDProxy (to a NSPR PRFileDesc *) for that file. See also: PR_Open in /usr/include/nspr4/prio.h -
NewTCPSocket
Open a new TCP Socket and create a new PRFDProxy for that socket. See also: PR_NewTCPSocket in /usr/include/nspr4/prio.h -
NewBufferPRFD
public static PRFDProxy NewBufferPRFD(BufferProxy read_buf, BufferProxy write_buf, byte[] peer_info) Create a new j_buffer backed PRFileDesc, mimicing a TCP socket with the specified peer_info. See also: newBufferPRFileDesc in org/mozilla/jss/ssl/javax/BufferPRFD.h -
Close
Close an existing PRFDProxy, clearing the pointer if successful. See also: PR_Close in /usr/include/nspr4/prio.h -
Close
Close an existing PRFDProxy with an option to clear the pointer. See also: PR_Close in /usr/include/nspr4/prio.h -
Close
Close an existing SSLFDProxy. See also: org.mozilla.jss.nss.PR.Close org.mozilla.jss.nss.SSLFDProxy.releaseNativeResources- Throws:
Exception
-
Shutdown
Shutdown an existing PRFDProxy. This is usually used with TCP modes. See also: PR_Shutdown in /usr/include/nspr4/prio.h -
Read
Read up to amount bytes from a PRFDProxy. See also: PR_Read in /usr/include/nspr4/prio.h -
Recv
Recv up to amount bytes from a PRFDProxy, given the specified receive flags and timeout value. See also: PR_Recv in /usr/include/nspr4/prio.h -
Write
Write the specified bytes to the PRFDProxy. Note: Unlike PR_Write, this method assumes the entire buffer is being written. See also: PR_Write in /usr/include/nspr4/prio.h -
Send
Send the specified bytes via the PRFDProxy, given the specified send flags and timeout value. See also: PR_Send in /usr/include/nspr4/prio.h -
GetError
public static int GetError()Get the value of the current PR error. This is cleared on each NSPR call. See also: PR_GetError in /usr/include/nspr4/prio.h -
GetErrorText
Get the error text of the current PR error. This is cleared on each NSPR call. See also: PR_GetErrorText in /usr/include/nspr4/prio.h -
GetErrorTextNative
private static byte[] GetErrorTextNative() -
ErrorToName
Get the constant name of the current PR error. This is cleared on each NSPR call. See also: PR_ErrorToName in /usr/include/nspr4/prio.h -
ErrorToNameNative
private static byte[] ErrorToNameNative(int code) -
getPRShutdownRcv
private static int getPRShutdownRcv() -
getPRShutdownSend
private static int getPRShutdownSend() -
getPRShutdownBoth
private static int getPRShutdownBoth() -
getPRSuccess
private static int getPRSuccess() -
getPRFailure
private static int getPRFailure()
-