| 
 | " 2013 FRC Java API" | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface GCFSockets
This defines the interface between the GCF sockets protocol and the platform's SocketAdapter. This interface is not designed for other uses.
| Method Summary | |
|---|---|
|  int | accept(int fd)Accept client connections on server socket fd. | 
|  int | available(int handle)Gets the number of bytes that can be read without blocking. | 
|  void | close(int handle)Closes the socket connection. | 
|  int | getSockOpt(int socket,
           int option_name)get a socket option | 
|  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 handle,
        byte[] b,
        int off,
        int len)Reads from the open socket connection. | 
|  int | readByte(int handle)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 | 
|  int | writeBuf(int handle,
         byte[] b,
         int off,
         int len)Writes to the open socket connection. | 
|  int | writeByte(int handle,
          int b)Writes to the open socket connection. | 
| Method Detail | 
|---|
int open(String hostname,
         int port,
         int mode)
         throws IOException
hostname - host nameport - TCP port at hostmode - connection mode (ignored, should be read/write?
IOException
int openServer(int port,
               int backlog)
               throws IOException
port - local TCP port to listen onbacklog - listen backlog.
IOException
int accept(int fd)
           throws IOException
fd - open server socket. See openServer(int, int).
IOException
int readBuf(int handle,
            byte[] b,
            int off,
            int len)
            throws IOException
handle - the socket descriptorb - the buffer into which the data is read.off - the start offset in array b
            at which the data is written.len - the maximum number of bytes to read.
IOException
int readByte(int handle)
             throws IOException
fd - the socket descriptor
IOException
int readByte(int fd,
             byte[] b)
             throws IOException
fd - the socket descriptorb - 
IOException
int writeBuf(int handle,
             byte[] b,
             int off,
             int len)
             throws IOException
handle - the socket descriptorb - 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
int writeByte(int handle,
              int b)
              throws IOException
handle - the socket descriptorb - the byte to write
IOException
int available(int handle)
              throws IOException
handle - the socket descriptor
IOException
void close(int handle)
           throws IOException
handle - the socket descriptor
IOException
void setSockOpt(int socket,
                int option_name,
                int option_value)
                throws IOException
socket - socket descriptoroption_name - option_value - new value
IOException - on error
int getSockOpt(int socket,
               int option_name)
               throws IOException
socket - 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 | |||||||||