public class PR
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static int |
FAILURE
Return value on failure from NSPR functions.
|
static int |
SHUTDOWN_BOTH
Shut down both sides of the TCP connection.
|
static int |
SHUTDOWN_RCV
Shut down the receiving side of the TCP connection.
|
static int |
SHUTDOWN_SEND
Shut down the sending side of the TCP connection.
|
static int |
SUCCESS
Return value on success from NSPR functions.
|
Constructor and Description |
---|
PR() |
Modifier and Type | Method and Description |
---|---|
static int |
Close(PRFDProxy fd)
Close an existing PRFDProxy, clearing the pointer if successful.
|
static int |
Close(PRFDProxy fd,
boolean clear)
Close an existing PRFDProxy with an option to clear the pointer.
|
static int |
Close(SSLFDProxy fd)
Close an existing SSLFDProxy.
|
static java.lang.String |
ErrorToName(int code)
Get the constant name of the current PR error.
|
static int |
GetError()
Get the value of the current PR error.
|
static java.lang.String |
GetErrorText()
Get the error text of the current PR error.
|
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 |
NewTCPSocket()
Open a new TCP Socket and create a new PRFDProxy for that socket.
|
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.
|
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 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.
|
static int |
Shutdown(PRFDProxy fd,
int how)
Shutdown an existing PRFDProxy.
|
static int |
Write(PRFDProxy fd,
byte[] buf)
Write the specified bytes to the PRFDProxy.
|
public static final int SHUTDOWN_RCV
public static final int SHUTDOWN_SEND
public static final int SHUTDOWN_BOTH
public static final int SUCCESS
public static final int FAILURE
public static PRFDProxy Open(java.lang.String name, int flags, int mode)
public static PRFDProxy NewTCPSocket()
public static PRFDProxy NewBufferPRFD(BufferProxy read_buf, BufferProxy write_buf, byte[] peer_info)
public static int Close(PRFDProxy fd)
public static int Close(PRFDProxy fd, boolean clear)
public static int Close(SSLFDProxy fd) throws java.lang.Exception
java.lang.Exception
public static int Shutdown(PRFDProxy fd, int how)
public static byte[] Read(PRFDProxy fd, int amount)
public static byte[] Recv(PRFDProxy fd, int amount, int flags, long timeout)
public static int Write(PRFDProxy fd, byte[] buf)
public static int Send(PRFDProxy fd, byte[] buf, int flags, long timeout)
public static int GetError()
public static java.lang.String GetErrorText()
public static java.lang.String ErrorToName(int code)