Package org.mozilla.jss.nss
Class PR
- java.lang.Object
-
- org.mozilla.jss.nss.PR
-
public class PR extends java.lang.ObjectThis class provides static access to raw NSPS calls with the PR prefix, and handles the usage of NativeProxy objects.
-
-
Field Summary
Fields Modifier and Type Field Description static intFAILUREReturn value on failure from NSPR functions.static intSHUTDOWN_BOTHShut down both sides of the TCP connection.static intSHUTDOWN_RCVShut down the receiving side of the TCP connection.static intSHUTDOWN_SENDShut down the sending side of the TCP connection.static intSUCCESSReturn value on success from NSPR functions.
-
Constructor Summary
Constructors Constructor Description PR()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static intClose(PRFDProxy fd)Close an existing PRFDProxy.static java.lang.StringErrorToName(int code)Get the constant name of the current PR error.static intGetError()Get the value of the current PR error.static java.lang.StringGetErrorText()Get the error text of the current PR error.static PRFDProxyNewBufferPRFD(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 PRFDProxyNewTCPSocket()Open a new TCP Socket and create a new PRFDProxy for that socket.static PRFDProxyOpen(java.lang.String name, int flags, int mode)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(PRFDProxy fd, int amount)Read up to amount bytes from a PRFDProxy.static byte[]Recv(PRFDProxy fd, int amount, int flags, long timeout)Recv up to amount bytes from a PRFDProxy, given the specified receive flags and timeout value.static intSend(PRFDProxy fd, byte[] buf, int flags, long timeout)Send the specified bytes via the PRFDProxy, given the specified send flags and timeout value.static intShutdown(PRFDProxy fd, int how)Shutdown an existing PRFDProxy.static intWrite(PRFDProxy fd, byte[] buf)Write the specified bytes to the PRFDProxy.
-
-
-
Field Detail
-
SHUTDOWN_RCV
public static final int SHUTDOWN_RCV
Shut down the receiving side of the TCP connection. See also: Shutdown
-
SHUTDOWN_SEND
public static final int SHUTDOWN_SEND
Shut down the sending side of the TCP connection. See also: Shutdown
-
SHUTDOWN_BOTH
public static final int SHUTDOWN_BOTH
Shut down both sides of the TCP connection. See also: Shutdown
-
SUCCESS
public static final int SUCCESS
Return value on success from NSPR functions. See also: PR_SUCCESS in /usr/include/nspr4/prtypes.h
-
FAILURE
public static final int FAILURE
Return value on failure from NSPR functions. See also: PR_FAILURE in /usr/include/nspr4/prtypes.h
-
-
Method Detail
-
Open
public static PRFDProxy Open(java.lang.String name, int flags, int mode)
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
public static PRFDProxy 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
public static int Close(PRFDProxy fd)
Close an existing PRFDProxy. See also: PR_Close in /usr/include/nspr4/prio.h
-
Shutdown
public static int Shutdown(PRFDProxy fd, int how)
Shutdown an existing PRFDProxy. This is usually used with TCP modes. See also: PR_Shutdown in /usr/include/nspr4/prio.h
-
Read
public static byte[] Read(PRFDProxy fd, int amount)
Read up to amount bytes from a PRFDProxy. See also: PR_Read in /usr/include/nspr4/prio.h
-
Recv
public static byte[] Recv(PRFDProxy fd, int amount, int flags, long timeout)
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
public static int Write(PRFDProxy fd, byte[] buf)
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
public static int Send(PRFDProxy fd, byte[] buf, int flags, long timeout)
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
public static java.lang.String 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
-
ErrorToName
public static java.lang.String ErrorToName(int code)
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
-
-