Symbian
Symbian Developer Library

SYMBIAN OS V9.4

Feedback

[Index] [Previous] [Next]

#include <SOCKET.H>
Link against: estlib.lib

SOCK_STREAM

SOCK_STREAM 1

Description

stream socket

[Top]


SOCK_DGRAM

SOCK_DGRAM 2

Description

datagram socket

[Top]


SOCK_SEQPACKET

SOCK_SEQPACKET 3

Description

sequenced packet stream

[Top]


SOCK_RAW

SOCK_RAW 4

Description

raw-protocol interface

[Top]


SOL_SOCKET

SOL_SOCKET 1

Description

options for socket level

[Top]


SO_DEBUG

SO_DEBUG 1

Description

turn on debugging info recording

[Top]


SO_RCVBUF

SO_RCVBUF 2

Description

receive buffer size

[Top]


SO_SNDBUF

SO_SNDBUF 3

Description

send buffer size

[Top]


SO_ERROR

SO_ERROR 9

Description

get error status and clear

[Top]


SO_REUSEADDR

SO_REUSEADDR 0x406

Description

reuse local addresses

[Top]


SO_BROADCAST

SO_BROADCAST -1

Description

permit sending of broadcast msgs, not supported in Symbian OS

[Top]


SO_USELOOPBACK

SO_USELOOPBACK -2

Description

bypass hardware when possible, not supported in Symbian OS

[Top]


SO_LINGER

SO_LINGER -3

Description

linger on close if data present, not supported in Symbian OS

[Top]


SO_OOBINLINE

SO_OOBINLINE -4

Description

leave received OOB data in line, not supported in Symbian OS

[Top]


AF_UNSPEC

AF_UNSPEC 0

Description

unspecified

[Top]


AF_LOCAL

AF_LOCAL 0x666

Description

local to host (pipes)

[Top]


AF_INET

AF_INET 0x0800

Description

internetwork: UDP, TCP, etc.

[Top]


AF_IRDA

AF_IRDA 0x0100

Description

IrDA.

[Top]


AF_PLP

AF_PLP 273

Description

Symbian link protocol.

[Top]


PF_UNSPEC

PF_UNSPEC AF_UNSPEC

Description

[Top]


PF_LOCAL

PF_LOCAL AF_LOCAL

Description

[Top]


PF_INET

PF_INET AF_INET

Description

[Top]


PF_IRDA

PF_IRDA AF_IRDA

Description

[Top]


PF_PLP

PF_PLP AF_PLP

Description

[Top]


SOMAXCONN

SOMAXCONN 5

Description

Maximum queue length specifiable by listen.

[Top]


MSG_PEEK

MSG_PEEK 1

Description

peek at incoming message

[Top]


MSG_OOB

MSG_OOB 1

Description

write out-of-band data

[Top]


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 sockaddrsockaddr *

Points to a sockaddr structure containing the socket address.

size_tsize_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.

[Top]


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 sockaddrsockaddr *

Points to a sockaddr structure containing the socket address.

size_tsize_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.

[Top]


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 sockaddrsockaddr *

Points to a sockaddr structure containing the socket address.

size_tsize_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.

[Top]


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

int

struct sockaddrsockaddr *

size_tsize_t *

Return value

int

On Success, returns 0. On Failure, returns -1, errno may be set.

[Top]


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 sockaddrsockaddr *

Points to a sockaddr structure containing the socket address.

size_tsize_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.

[Top]


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

int

int

int

void *

size_tsize_t *

Return value

int

On Success, returns 0. On Failure, returns -1, errno may be set.

[Top]


listen(int,int)

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.

[Top]


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_tsize_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.

[Top]


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

int

char *

size_tsize_t

int

struct sockaddrsockaddr *

size_tsize_t *

Return value

int

On Succcess, returns length of message in bytes, can be 0. On Failure, returns -1, errno may be set.

[Top]


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_tsize_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.

[Top]


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

int

const char *

size_tsize_t

int

struct sockaddrsockaddr *

size_tsize_t

Return value

int

On Success, returns the numbers of characters sent. On Failure, returns -1, errno may be set.

[Top]


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_tsize_t

Specifies the length of the option value.

Return value

int

On Success, returns 0. On Failure, returns -1, errno may be set.

[Top]


socket(int,int,int)

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.

[Top]


shutdown(int,int)

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.