|
" 2013 FRC Java API " |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.sun.squawk.platform.posix.GCFSocketsImpl
public class GCFSocketsImpl
POSIX implementation of GCFSockets that calls the BSD socket API.
| Field Summary | |
|---|---|
static boolean |
DEBUG
|
static boolean |
NBIO_WORKS
|
| Constructor Summary | |
|---|---|
GCFSocketsImpl()
|
|
| Method Summary | |
|---|---|
int |
accept(int fd)
Accept client connections on server socket fd. |
int |
available(int fd)
Gets the number of bytes that can be read without blocking. |
void |
close(int fd)
Closes the socket connection. |
int |
getSockOpt(int socket,
int option_name)
get a socket option |
int |
getSockOpt(int socket,
int level,
int option_name)
get a socket option |
String |
inet_ntop(int in)
Takes an IPv4 Internet address and returns string representing the address in `.' notation |
int |
open(String hostname,
int port,
int mode)
Opens a TCP connection to a server. |
int |
openServer(int port,
int backlog)
Opens a server TCP connection to clients. |
int |
readBuf(int fd,
byte[] b,
int offset,
int length)
Reads from the open socket connection. |
int |
readByte(int fd)
Read a byte from the open socket connection. |
int |
readByte(int fd,
byte[] b)
Read a byte from the open socket connection. |
void |
setSockOpt(int socket,
int option_name,
int option_value)
set a socket option |
void |
setSockOpt(int socket,
int level,
int option_name,
int option_value)
set a socket option |
int |
writeBuf(int fd,
byte[] buffer,
int off,
int len)
Writes to the open socket connection. |
int |
writeByte(int fd,
int b)
Writes to the open socket connection. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final boolean DEBUG
public static final boolean NBIO_WORKS
| Constructor Detail |
|---|
public GCFSocketsImpl()
| Method Detail |
|---|
public int open(String hostname,
int port,
int mode)
throws IOException
GCFSockets
open in interface GCFSocketshostname - host nameport - TCP port at hostmode - connection mode (ignored, should be read/write?
IOExceptionpublic String inet_ntop(int in)
in - the opaque bytes of an IPv4 "struct in_addr"
public int openServer(int port,
int backlog)
throws IOException
openServer in interface GCFSocketsport - local TCP port to listen onbacklog - listen backlog.
IOException
public int accept(int fd)
throws IOException
accept in interface GCFSocketsfd - open server socket. See openServer(int, int).
IOException
public int readBuf(int fd,
byte[] b,
int offset,
int length)
throws IOException
GCFSockets
readBuf in interface GCFSocketsfd - the socket descriptorb - the buffer into which the data is read.offset - the start offset in array b
at which the data is written.length - the maximum number of bytes to read.
IOException
public int readByte(int fd,
byte[] b)
throws IOException
GCFSockets
readByte in interface GCFSocketsfd - the socket descriptor
IOException
public int readByte(int fd)
throws IOException
GCFSockets
readByte in interface GCFSocketsIOException
public int writeBuf(int fd,
byte[] buffer,
int off,
int len)
throws IOException
GCFSockets
writeBuf in interface GCFSocketsfd - the socket descriptorbuffer - the buffer of the data to writeoff - the start offset in array b
at which the data is written.len - the number of bytes to write.
IOException
public int writeByte(int fd,
int b)
throws IOException
GCFSockets
writeByte in interface GCFSocketsfd - the socket descriptorb - the byte to write
IOException
public int available(int fd)
throws IOException
GCFSockets
available in interface GCFSocketsfd - the socket descriptor
IOException
public void close(int fd)
throws IOException
GCFSockets
close in interface GCFSocketsfd - the socket descriptor
IOException
public void setSockOpt(int socket,
int level,
int option_name,
int option_value)
throws IOException
socket - socket descriptorlevel - Socket.SOL_SOCKET, etc.option_name - option_value - new value
IOException - on error
public int getSockOpt(int socket,
int level,
int option_name)
throws IOException
socket - socket descriptorlevel - Socket.SOL_SOCKET, etc.option_name -
IOException - on error
public void setSockOpt(int socket,
int option_name,
int option_value)
throws IOException
setSockOpt in interface GCFSocketssocket - socket descriptoroption_name - option_value - new value
IOException - on error
public int getSockOpt(int socket,
int option_name)
throws IOException
getSockOpt in interface GCFSocketssocket - socket descriptoroption_name -
IOException - on error
|
" 2013 FRC Java API " |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||