#include <SOCKET.H>
Link against:
estlib.lib
SOCK_STREAM 1
Description
stream socket
SOCK_DGRAM 2
Description
datagram socket
SOCK_SEQPACKET 3
Description
sequenced packet stream
SOCK_RAW 4
Description
raw-protocol interface
SOL_SOCKET 1
Description
options for socket level
SO_DEBUG 1
Description
turn on debugging info recording
SO_RCVBUF 2
Description
receive buffer size
SO_SNDBUF 3
Description
send buffer size
SO_ERROR 9
Description
get error status and clear
SO_REUSEADDR 0x406
Description
reuse local addresses
SO_BROADCAST -1
Description
permit sending of broadcast msgs, not supported in Symbian OS
SO_USELOOPBACK -2
Description
bypass hardware when possible, not supported in Symbian OS
SO_LINGER -3
Description
linger on close if data present, not supported in Symbian OS
SO_OOBINLINE -4
Description
leave received OOB data in line, not supported in Symbian OS
AF_UNSPEC 0
Description
unspecified
AF_LOCAL 0x666
Description
local to host (pipes)
AF_INET 0x0800
Description
internetwork: UDP, TCP, etc.
AF_IRDA 0x0100
Description
IrDA.
AF_PLP 273
Description
Symbian link protocol.
PF_UNSPEC AF_UNSPEC
Description
PF_LOCAL AF_LOCAL
Description
PF_INET AF_INET
Description
PF_IRDA AF_IRDA
Description
PF_PLP AF_PLP
Description
SOMAXCONN 5
Description
Maximum queue length specifiable by listen.
MSG_PEEK 1
Description
peek at incoming message
MSG_OOB 1
Description
write out-of-band data
accept(int,struct sockaddr *,size_t *)
IMPORT_C int accept(int, struct sockaddr *, size_t *);
Description
accepts a connection on a socket. An incoming connection is acknowledged and associated with an immediately created socket.
The original socket is returned to the listening state.
Parameters
int |
Is the integer descriptor of the desired socket.
|
struct sockaddr sockaddr * |
Points to a sockaddr structure containing the socket address.
|
size_t size_t * |
Points to an integer that states the address length in bytes.
|
|
Return value
int |
On Success, returns a non-negative integer, which is a descriptor of the accepted socket. Upon return, addrlen contains the
actual length in bytes of the address returned. On Failure, returns -1, errno may be set.
|
|
bind(int,struct sockaddr *,size_t)
IMPORT_C int bind(int, struct sockaddr *, size_t);
Description
Associate that socket with a port.
Parameters
int |
Is the integer descriptor of the desired socket.
|
struct sockaddr sockaddr * |
Points to a sockaddr structure containing the socket address.
|
size_t size_t
|
Points to an integer that states the address length in bytes.
|
|
Return value
int |
On Success, returns 0. On Failure, returns -1, errno may be set.
|
|
connect(int,struct sockaddr *,size_t)
IMPORT_C int connect(int, struct sockaddr *, size_t);
Description
Used by a client program to establish communication with a remote entity
Parameters
int |
Is the integer descriptor of the desired socket.
|
struct sockaddr sockaddr * |
Points to a sockaddr structure containing the socket address.
|
size_t size_t
|
Points to an integer that states the address length in bytes.
|
|
Return value
int |
On Success, returns 0. On Failure, returns -1, errno may be set.
|
|
getpeername(int,struct sockaddr *,size_t *)
IMPORT_C int getpeername(int, struct sockaddr *, size_t *);
Description
Returns the peer address of the specified socket.
Parameters
Return value
int |
On Success, returns 0. On Failure, returns -1, errno may be set.
|
|
getsockname(int,struct sockaddr *,size_t *)
IMPORT_C int getsockname(int, struct sockaddr *, size_t *);
Description
Returns the current name for the specified socket. The namelen parameter should be initialized to indicate the amount of space
pointed to by name. When returned, namelen contains the actual size (in bytes) of the name returned.
Parameters
int |
Is the integer descriptor of the desired socket.
|
struct sockaddr sockaddr * |
Points to a sockaddr structure containing the socket address.
|
size_t size_t * |
Points to an integer that states the address length in bytes.
|
|
Return value
int |
On Success, returns 0. On Failure, returns -1, errno may be set.
|
|
getsockopt(int,int,int,void *,size_t *)
IMPORT_C int getsockopt(int, int, int, void *, size_t *);
Description
Manipulates options associated with a socket.
Parameters
Return value
int |
On Success, returns 0. On Failure, returns -1, errno may be set.
|
|
IMPORT_C int listen(int, int);
Description
Marks a connection-mode socket, specified by the socket argument fd, as accepting connections, and limits the number of outstanding
connections in the socket's listen queue to the value specified by the n argument. The socket fd is put into 'passive' mode
where incoming connection requests are acknowledged and queued pending acceptance by the process.
Parameters
int |
Is a descriptor identifying a bound, unconnected socket.
|
int |
Is the maximum length that the queue of pending connections may grow to. If this value is SOMAXCONN, then the underlying service
provider responsible for socket fd sets the backlog to a maximum "reasonable" value.
|
|
Return value
int |
On Success, returns 0. On Failure, returns -1, errno may be set.
|
|
recv(int,char *,size_t,int)
IMPORT_C int recv(int, char *, size_t, int);
Description
Receives a message from a socket. The recv(int,char *,size_t,int)
recv(int,char *,size_t,int)
call can be used on a connection mode socket or a bound, connectionless socket. If no messages are available at the socket,
the recv(int,char *,size_t,int)
recv(int,char *,size_t,int)
call waits for a message to arrive unless the socket is nonblocking.
Parameters
int |
Specifies a socket descriptor to use for the send.
|
char * |
Points to the buffer containing message to send.
|
size_t size_t
|
Specifies the length of the message in bytes.
|
int |
Lets the sender control the way data is sent.
|
|
Return value
int |
On Success, returns the number of bytes received. On Failure, returns -1, eerno may be set.
|
|
recvfrom(int,char *,size_t,int,struct sockaddr *,size_t *)
IMPORT_C int recvfrom(int, char *, size_t, int, struct sockaddr *, size_t *);
Description
Parameters
Return value
int |
On Succcess, returns length of message in bytes, can be 0. On Failure, returns -1, errno may be set.
|
|
send(int,const char *,size_t,int)
IMPORT_C int send(int, const char *, size_t, int);
Description
Initiates transmission of a message from the specified socket to its peer. The send(int,const char *,size_t,int)
send(int,const char *,size_t,int)
function sends a message only when the socket is connected.
Parameters
int |
Specifies a socket descriptor to use for the send.
|
const char * |
Points to the buffer containing message to send.
|
size_t size_t
|
Specifies the length of the message in bytes.
|
int |
Lets the sender control the way data is sent.
|
|
Return value
int |
On Success, returns the numbers of characters sent. On Failure, returns -1, errno may be set.
|
|
sendto(int,const char *,size_t,int,struct sockaddr *,size_t)
IMPORT_C int sendto(int, const char *, size_t, int, struct sockaddr *, size_t);
Description
Parameters
Return value
int |
On Success, returns the numbers of characters sent. On Failure, returns -1, errno may be set.
|
|
setsockopt(int,int,int,void *,size_t)
IMPORT_C int setsockopt(int, int, int, void *, size_t);
Description
Manipulates options associated with a socket. Options can exist at multiple protocol levels. However, the options are always
present at the uppermost socket level. Options affect socket operations, such as the routing of packets, out-of-band data
transfer, and so on.
Parameters
int |
Specifies a socket for which an option should be set.
|
int |
Identifies whether the operation applies to the socket itself or to the underlying protocol being used. The socket itself
is identified by the symbolic constant SOL_SOCKET. Other protocol levels require the protocol number for the appropriate protocol
controlling the option.
|
int |
Specifies a single option to which the request applies, negative option values are not support on Symbian OS.
|
void * |
Specifies a value for the option.
|
size_t size_t
|
Specifies the length of the option value.
|
|
Return value
int |
On Success, returns 0. On Failure, returns -1, errno may be set.
|
|
IMPORT_C int socket(int, int, int);
Description
Parameters
int |
Specifies the address family used in the communications domain.
|
int |
Type of socket.
|
int |
Protocol used with that socket.
|
|
Return value
int |
On Success, non-negative integer, the socket file descriptor. On Failure, returns -1, eerno may be set.
|
|
IMPORT_C int shutdown(int, int);
Description
Shuts down all or part of a full-duplex connection on the socket associated with fd.
Parameters
int |
Is the socket descriptor to shut down.
|
int |
Specifies the type of shutdown.
|
|
Return value
int |
On Success, returns 0. On Failure, returns -1, errno may be set.
|
|