|
" 2013 FRC Java API " |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Socket
java wrapper around BSD sockets
Nested Class Summary | |
---|---|
static class |
Socket.sockaddr_in
C STRUCTURE sockaddr_in / struct sockaddr_in { u_char sin_len; 1 u_char sin_family; 1 u_short sin_port; 2 struct in_addr sin_addr; 4 char sin_zero[8]; 8 }; struct sockaddr { __uint8_t sa_len; /* total length sa_family_t sa_family; /* [XSI] address family char sa_data[14]; /* [XSI] addr value (actually larger) }; |
Field Summary | |
---|---|
static int |
AF_INET
|
static int |
INADDR_ANY
|
static int |
INET_ADDRSTRLEN
|
static Socket |
INSTANCE
|
static int |
IPPROTO_TCP
|
static int |
SO_ACCEPTCONN
|
static int |
SO_BROADCAST
|
static int |
SO_DEBUG
|
static int |
SO_DONTROUTE
|
static int |
SO_ERROR
|
static int |
SO_KEEPALIVE
|
static int |
SO_OOBINLINE
|
static int |
SO_RCVBUF
|
static int |
SO_RCVLOWAT
|
static int |
SO_RCVTIMEO
|
static int |
SO_REUSEADDR
|
static int |
SO_SNDBUF
|
static int |
SO_SNDLOWAT
|
static int |
SO_SNDTIMEO
|
static int |
SO_TYPE
|
static int |
SOCK_DGRAM
|
static int |
SOCK_RAW
|
static int |
SOCK_STREAM
|
static int |
SOL_SOCKET
|
static int |
TCP_NODELAY
|
Method Summary | |
---|---|
int |
accept(int socket,
Socket.sockaddr_in remoteAddress,
IntByReference address_len)
accept a connection from a client |
int |
bind(int socket,
Socket.sockaddr_in myaddress,
int address_len)
bind a socket to a port |
int |
connect(int socket,
Socket.sockaddr_in address,
int address_len)
initiate a connection on a socket. |
int |
getsockopt(int socket,
int level,
int option_name,
ByReference option_value,
IntByReference option_len)
get a socket option |
String |
inet_ntop(int af,
IntByReference src,
Pointer dst,
int size)
Takes an IPv4 Internet address and returns string representing the address in `.' notation |
boolean |
inet_pton(String str,
IntByReference in_addr)
Interprets the specified character string as an Internet address, placing the address into the structure provided. |
int |
listen(int socket,
int backlog)
listen for connections on socket |
int |
setsockopt(int socket,
int level,
int option_name,
ByReference option_value,
int option_len)
set a socket option |
int |
shutdown(int socket,
int how)
initiate a connection on a socket. |
int |
socket(int domain,
int type,
int protocol)
socket() creates an endpoint for communication and returns a descriptor. |
Methods inherited from interface com.sun.cldc.jna.Library |
---|
initConstInt |
Field Detail |
---|
static final Socket INSTANCE
static final int AF_INET
static final int SOCK_STREAM
static final int SOCK_DGRAM
static final int SOCK_RAW
static final int INADDR_ANY
static final int INET_ADDRSTRLEN
static final int SOL_SOCKET
static final int SO_DEBUG
static final int SO_ACCEPTCONN
static final int SO_REUSEADDR
static final int SO_KEEPALIVE
static final int SO_DONTROUTE
static final int SO_BROADCAST
static final int SO_OOBINLINE
static final int IPPROTO_TCP
static final int TCP_NODELAY
static final int SO_SNDBUF
static final int SO_RCVBUF
static final int SO_SNDLOWAT
static final int SO_RCVLOWAT
static final int SO_SNDTIMEO
static final int SO_RCVTIMEO
static final int SO_ERROR
static final int SO_TYPE
Method Detail |
---|
int socket(int domain, int type, int protocol)
domain
- specifies a communications domain within which communication
will take place; this selects the protocol family which should
be used. The currently understood formats are:
AF_UNIX, AF_INET, AF_ISO, AF_NS, AF_IMPLINKtype
- specifies the semantics of communication. Currently defined types are:
SOCK_STREAM, SOCK_DGRAM, SOCK_RAW, SOCK_SEQPACKET, SOCK_RDMprotocol
- The protocol number to use is particular to the
communication domain in which communication is to take place; see
protocols(5).
int connect(int socket, Socket.sockaddr_in address, int address_len)
socket
- socket descriptoraddress
- ptr to a sockaddr_in bufferaddress_len
- pass in sockaddr_in.size()
int bind(int socket, Socket.sockaddr_in myaddress, int address_len)
socket
- socket descriptormyaddress
- ptr to a sockaddr_in bufferaddress_len
- size of sockaddr_in
int accept(int socket, Socket.sockaddr_in remoteAddress, IntByReference address_len)
socket
- socket descriptorremoteAddress
- ptr to a SockAddr_In buffer that will contain the address of the remote clientaddress_len
- pointer to int containing the size of an IP address
int listen(int socket, int backlog)
socket
- socket descriptorbacklog
-
int shutdown(int socket, int how)
socket
- socket descriptorhow
- If how is SHUT_RD, further receives will be disallowed. If how
is SHUT_WR, further sends will be disallowed. If how is SHUT_RDWR, further sends and
receives will be disallowed.
boolean inet_pton(String str, IntByReference in_addr)
str
- in_addr
- (OUT) on sucessful return will contain the 32 bits of an IPv4 "struct in_addr"
String inet_ntop(int af, IntByReference src, Pointer dst, int size)
af
- family (should be AF_INET)src
- a pointer to the src internet addressdst
- a pointer to tmp buffer used to store characters for the result.size
- the size of the tmp dst buffer
int setsockopt(int socket, int level, int option_name, ByReference option_value, int option_len)
socket
- socket descriptorlevel
- option_name
- option_value
- option_len
- (option_value.size()
int getsockopt(int socket, int level, int option_name, ByReference option_value, IntByReference option_len)
socket
- socket descriptorlevel
- option_name
- option_value
- option_len
- On return, the by-reference int will contain the size of the option_value data
|
" 2013 FRC Java API " |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |