Overview | Namespace | Class | Index | Help |
Global Functions in Global Namespace C++
in Sourcefile socket.h
- osl_acceptConnectionOnSocket
- extern "C"
oslSocket osl_acceptConnectionOnSocket( oslSocket Socket, oslSocketAddr * pAddr );
- extern "C"
virtual abstract const volatile template static inline C-linkage NO NO NO NO NO NO NO YES
- Summary
Waits for an ingoing connection on the socket. This call blocks if there is no incoming connection present.
- Parameters
pAddr if pAddr is != 0, the peers address is returned.
- Return
0 if the accept-call failed, otherwise you get a socket representing the new connection.
- osl_acquireSocket
- extern "C"
void osl_acquireSocket( oslSocket Socket );
- extern "C"
virtual abstract const volatile template static inline C-linkage NO NO NO NO NO NO NO YES
- Summary
increases the refcount of the socket handle by one
- osl_addToSocketSet
- extern "C"
void osl_addToSocketSet( oslSocketSet Set, oslSocket Socket );
- extern "C"
virtual abstract const volatile template static inline C-linkage NO NO NO NO NO NO NO YES
- Summary
Adds a socket to the set.
- Parameters
Set the set were the socket is added.
Socket the socket to be added.
- osl_bindAddrToSocket
- extern "C"
sal_Bool osl_bindAddrToSocket( oslSocket Socket, oslSocketAddr Addr );
- extern "C"
virtual abstract const volatile template static inline C-linkage NO NO NO NO NO NO NO YES
- Summary
Binds the given address to the socket.
- Parameters
Socket Address - Return
False if the bind failed.
- osl_clearSocketSet
- extern "C"
void osl_clearSocketSet( oslSocketSet Set );
- extern "C"
virtual abstract const volatile template static inline C-linkage NO NO NO NO NO NO NO YES
- Summary
Clears the set from all previously added sockets.
- Parameters
Set the set to be cleared.
- osl_closeSocket
- extern "C"
void osl_closeSocket( oslSocket Socket );
- extern "C"
virtual abstract const volatile template static inline C-linkage NO NO NO NO NO NO NO YES
- osl_connectSocketTo
- extern "C"
oslSocketResult osl_connectSocketTo( oslSocket Socket, oslSocketAddr Addr, const TimeValue * pTimeout );
- extern "C"
virtual abstract const volatile template static inline C-linkage NO NO NO NO NO NO NO YES
- Summary
Connects the socket to the given address.
- Parameters
Socket a bound socket.
Addr the peer address.
pTimeout Timeout value or NULL for blocking.
- Return
osl_sock_result_ok on successful connection, osl_sock_result_timeout if operation timed out, osl_sock_result_interrupted if operation was interrupted osl_sock_result_error if the connection failed.
- osl_copyHostAddr
- extern "C"
oslHostAddr osl_copyHostAddr( const oslHostAddr Addr );
- extern "C"
virtual abstract const volatile template static inline C-linkage NO NO NO NO NO NO NO YES
- Summary
Create a copy of the given Addr.
- Return
The copied address or 0 upon failure.
- osl_copySocketAddr
- extern "C"
oslSocketAddr osl_copySocketAddr( oslSocketAddr Addr );
- extern "C"
virtual abstract const volatile template static inline C-linkage NO NO NO NO NO NO NO YES
- Summary
Create a new SocketAddress and fill it from Addr.
- osl_createEmptySocketAddr
- extern "C"
oslSocketAddr osl_createEmptySocketAddr( oslAddrFamily Family );
- extern "C"
virtual abstract const volatile template static inline C-linkage NO NO NO NO NO NO NO YES
- Description
Creates a socket-address for the given family. If family == osl_af_inet the address is set to INADDR_ANY port 0.
- Return
0 if address could not be created.
- osl_createHostAddr
- extern "C"
oslHostAddr osl_createHostAddr( rtl_uString * strHostname, const oslSocketAddr Addr );
- extern "C"
virtual abstract const volatile template static inline C-linkage NO NO NO NO NO NO NO YES
- Summary
Create an oslHostAddr from given hostname and socket address.
- Parameters
strHostname The hostname to be stored.
Addr The socket address to be stored.
- Return
The created address or 0 upon failure.
- osl_createHostAddrByAddr
- extern "C"
oslHostAddr osl_createHostAddrByAddr( const oslSocketAddr Addr );
- extern "C"
virtual abstract const volatile template static inline C-linkage NO NO NO NO NO NO NO YES
- Description
Create an oslHostAddr by reverse resolution of the given Addr. Successful name resolution should result in the fully qualified domain name (FQDN) and it's address as hostname and socket address members of the resulting oslHostAddr.
- Parameters
Addr The socket address to be reverse resolved.
- Return
The resulting address or 0 upon failure.
- osl_createHostAddrByName
- extern "C"
oslHostAddr osl_createHostAddrByName( rtl_uString * strHostname );
- extern "C"
virtual abstract const volatile template static inline C-linkage NO NO NO NO NO NO NO YES
- Description
Create an oslHostAddr by resolving the given strHostname. Successful name resolution should result in the fully qualified domain name (FQDN) and it's address as hostname and socket address members of the resulting oslHostAddr.
- Parameters
strHostname The hostname to be resolved.
- Return
The resulting address or 0 upon failure.
- osl_createInetBroadcastAddr
- extern "C"
oslSocketAddr osl_createInetBroadcastAddr( rtl_uString * strDottedAddr, sal_Int32 Port );
- extern "C"
virtual abstract const volatile template static inline C-linkage NO NO NO NO NO NO NO YES
- Description
Create an internet address usable for sending broadcast datagrams. To limit the broadcast to your subnet, pass your hosts IP address in dotted decimal notation as first argument.
- See Also
- osl_sendToSocket(...,
oslSocketAddr
ReceiverAddr,
...).
- Parameters
strDottedAddr dotted decimal internet address, may be 0.
Port port number in host byte order.
- Return
0 if address could not be created.
- osl_createInetSocketAddr
- extern "C"
oslSocketAddr osl_createInetSocketAddr( rtl_uString * strDottedAddr, sal_Int32 Port );
- extern "C"
virtual abstract const volatile template static inline C-linkage NO NO NO NO NO NO NO YES
- Description
Create an internet-address, consisting of hostaddress and port. We interpret strDottedAddr as a dotted-decimal inet-addr (e.g. "141.99.128.50").
- Parameters
strDottedAddr String with dotted address.
Port portnumber in host byte order.
- Return
0 if address could not be created.
- osl_createIpxSocketAddr
- extern "C"
oslSocketAddr osl_createIpxSocketAddr( rtl_uString * strNetNumber, rtl_uString * strNodeNumber, sal_uInt32 SocketNumber );
- extern "C"
virtual abstract const volatile template static inline C-linkage NO NO NO NO NO NO NO YES
- Summary
Create an IPX address.
- osl_createSocket
- extern "C"
oslSocket osl_createSocket( oslAddrFamily Family, oslSocketType Type, oslProtocol Protocol );
- extern "C"
virtual abstract const volatile template static inline C-linkage NO NO NO NO NO NO NO YES
- Summary
Create a socket of the specified Family and Type. The semantic of the Protocol parameter depends on the given family and type.
- Return
0 if socket could not be created, otherwise you get a handle to the allocated socket-datastructure.
- osl_createSocketSet
- extern "C"
oslSocketSet osl_createSocketSet();
- extern "C"
virtual abstract const volatile template static inline C-linkage NO NO NO NO NO NO NO YES
- Summary
Creates a set of sockets to be used with osl_demultiplexSocketEvents().
- Return
A oslSocketSet or 0 if creation failed.
- osl_demultiplexSocketEvents
- extern "C"
sal_Int32 osl_demultiplexSocketEvents( oslSocketSet IncomingSet, oslSocketSet OutgoingSet, oslSocketSet OutOfBandSet, const TimeValue * pTimeout );
- extern "C"
virtual abstract const volatile template static inline C-linkage NO NO NO NO NO NO NO YES
- Summary
Checks multiple sockets for events.
- Parameters
IncomingSet Checks the sockets in this set for incoming events (read, accept). If the set is 0, it is just skipped.
OutgoingSet Checks the sockets in this set for outgoing events (write, connect). If the set is 0, it is just skipped.
OutOfBandSet Checks the sockets in this set for out-of-band events. If the set is 0, it is just skipped.
msTimeout Number of milliseconds to wait for events. If msTimeout is -1, the call will block until an event or an error occurs.
- Return
-1 on errors, otherwise the number of sockets with pending events. In case of timeout, the number might be 0.
- osl_destroyHostAddr
- extern "C"
void osl_destroyHostAddr( oslHostAddr Addr );
- extern "C"
virtual abstract const volatile template static inline C-linkage NO NO NO NO NO NO NO YES
- Summary
Free all memory allocated by Addr.
- osl_destroySocketAddr
- extern "C"
void osl_destroySocketAddr( oslSocketAddr Addr );
- extern "C"
virtual abstract const volatile template static inline C-linkage NO NO NO NO NO NO NO YES
- Summary
Free all memory allocated by pAddress.
- osl_destroySocketSet
- extern "C"
void osl_destroySocketSet( oslSocketSet Set );
- extern "C"
virtual abstract const volatile template static inline C-linkage NO NO NO NO NO NO NO YES
- Summary
Destroys a oslSocketSet.
- osl_enableNonBlockingMode
-
virtual abstract const volatile template static inline C-linkage NO NO NO NO NO NO NO YES
- Summary
Enables/disables non-blocking-mode of the socket.
- Parameters
Socket Change mode for this socket.
On True: enable non-blocking mode, False: disable non-blocking mode.
- Return
True if mode could be changed.
- osl_getAddrOfSocketAddr
- extern "C"
oslSocketResult osl_getAddrOfSocketAddr( oslSocketAddr Addr, sal_Sequence * * ppByteSeq );
- extern "C"
virtual abstract const volatile template static inline C-linkage NO NO NO NO NO NO NO YES
- Summary
Returns the addr field in the struct sockaddr. ppByteSeq is in network byteorder. *ppByteSeq may either be 0 or contain a constructed sal_Sequence.
- osl_getDottedInetAddrOfSocketAddr
- extern "C"
oslSocketResult osl_getDottedInetAddrOfSocketAddr( oslSocketAddr Addr, rtl_uString * * strDottedInetAddr );
- extern "C"
virtual abstract const volatile template static inline C-linkage NO NO NO NO NO NO NO YES
- Summary
Gets the address in dotted decimal format.
- Return
the dotted decimal address (e.g. 141.99.20.34) represented by the address. If the address is invalid or not of type osl_af_inet, it returns 0.
- osl_getFamilyOfSocketAddr
- extern "C"
oslAddrFamily osl_getFamilyOfSocketAddr( oslSocketAddr Addr );
- extern "C"
virtual abstract const volatile template static inline C-linkage NO NO NO NO NO NO NO YES
- Summary
Retrieves the address-family from the Addr.
- Return
the family of the socket-address. In case of an unknown family you get osl_invalid_AddrFamily.
- osl_getHostnameOfHostAddr
- extern "C"
void osl_getHostnameOfHostAddr( const oslHostAddr Addr, rtl_uString * * strHostname );
- extern "C"
virtual abstract const volatile template static inline C-linkage NO NO NO NO NO NO NO YES
- Summary
Get the hostname member of Addr.
- Return
The hostname or 0 upon failure.
- osl_getHostnameOfSocketAddr
- extern "C"
oslSocketResult osl_getHostnameOfSocketAddr( oslSocketAddr Addr, rtl_uString * * strHostname );
- extern "C"
virtual abstract const volatile template static inline C-linkage NO NO NO NO NO NO NO YES
- Summary
Gets the hostname represented by Addr.
- Return
the hostname represented by the address. If there is no hostname to be found, it returns 0.
- osl_getInetPortOfSocketAddr
- extern "C"
sal_Int32 osl_getInetPortOfSocketAddr( oslSocketAddr Addr );
- extern "C"
virtual abstract const volatile template static inline C-linkage NO NO NO NO NO NO NO YES
- Summary
Retrieves the internet port-number of Addr.
- Return
the port-number of the address in host-byte order. If Addr is not an address of type osl_af_inet, it returns OSL_INVALID_PORT
- osl_getIpxNetNumber
- extern "C"
oslSocketResult osl_getIpxNetNumber( oslSocketAddr Addr, oslSocketIpxNetNumber NetNumber );
- extern "C"
virtual abstract const volatile template static inline C-linkage NO NO NO NO NO NO NO YES
- Summary
Gets the IPX Net-Number of the address.
- Return
the (4 bytes long) net-number or 0 if not an IPX address.
- osl_getIpxNodeNumber
- extern "C"
oslSocketResult osl_getIpxNodeNumber( oslSocketAddr Addr, oslSocketIpxNodeNumber NodeNumber );
- extern "C"
virtual abstract const volatile template static inline C-linkage NO NO NO NO NO NO NO YES
- Summary
Gets the IPX Node-Number of the address.
- Return
the (6 bytes long) net-number or 0 if not an IPX address.
- osl_getIpxSocketNumber
- extern "C"
sal_Int32 osl_getIpxSocketNumber( oslSocketAddr Addr );
- extern "C"
virtual abstract const volatile template static inline C-linkage NO NO NO NO NO NO NO YES
- Summary
Gets the IPX Socket-Number of the address.
- Return
the IPX socket number or OSL_INVALID_IPX_SOCKET_NO if not an IPX address.
- osl_getLastSocketError
- extern "C"
oslSocketError osl_getLastSocketError( oslSocket Socket );
- extern "C"
virtual abstract const volatile template static inline C-linkage NO NO NO NO NO NO NO YES
- Summary
Delivers a constant decribing the last error for the socket system.
- Return
osl_Socket_E_NONE if no error occured, osl_invalid_SocketError if an unknown (unmapped) error occured, otherwise an enum describing the error.
- osl_getLastSocketErrorDescription
- extern "C"
void osl_getLastSocketErrorDescription( oslSocket Socket, rtl_uString * * strError );
- extern "C"
virtual abstract const volatile template static inline C-linkage NO NO NO NO NO NO NO YES
- Summary
Delivers a string which describes the last socket error.
- Parameters
strError The string that receives the error message. than the provided buffer, it will be cut short. Buffer sizes about 128 chars should be large enough.
- osl_getLocalAddrOfSocket
- extern "C"
oslSocketAddr osl_getLocalAddrOfSocket( oslSocket Socket );
- extern "C"
virtual abstract const volatile template static inline C-linkage NO NO NO NO NO NO NO YES
- Description
Retrieves the Address of the local end of the socket. Note that a socket must be bound or connected before a vaild address can be returned.
- Return
0 if socket-address could not be created, otherwise you get the created Socket-Address.
- osl_getLocalHostname
- extern "C"
oslSocketResult osl_getLocalHostname( rtl_uString * * strLocalHostname );
- extern "C"
virtual abstract const volatile template static inline C-linkage NO NO NO NO NO NO NO YES
- Summary
Retrieve this machines hostname. May not always be a fully qualified domain name (FQDN).
- Parameters
strLocalHostname The string that receives the local host name.
- Return
True upon success, False otherwise.
- osl_getPeerAddrOfSocket
- extern "C"
oslSocketAddr osl_getPeerAddrOfSocket( oslSocket Socket );
- extern "C"
virtual abstract const volatile template static inline C-linkage NO NO NO NO NO NO NO YES
- Description
Retrieves the Address of the remote end of the socket. Note that a socket must be connected before a vaild address can be returned.
- Return
0 if socket-address could not be created, otherwise you get the created Socket-Address.
- osl_getServicePort
- extern "C"
sal_Int32 osl_getServicePort( rtl_uString * strServicename, rtl_uString * strProtocol );
- extern "C"
virtual abstract const volatile template static inline C-linkage NO NO NO NO NO NO NO YES
- Summary
Looks up the port-number designated to the specified service/protocol-pair. (e.g. "ftp" "tcp").
- Return
OSL_INVALID_PORT if no appropriate entry was found, otherwise the port-number.
- osl_getSocketAddrOfHostAddr
- extern "C"
oslSocketAddr osl_getSocketAddrOfHostAddr( const oslHostAddr Addr );
- extern "C"
virtual abstract const volatile template static inline C-linkage NO NO NO NO NO NO NO YES
- Summary
Get the socket address member of Addr.
- Return
The socket address or 0 upon failure.
- osl_getSocketOption
- extern "C"
sal_Int32 osl_getSocketOption( oslSocket Socket, oslSocketOptionLevel Level, oslSocketOption Option, void * pBuffer, sal_uInt32 BufferLen );
- extern "C"
virtual abstract const volatile template static inline C-linkage NO NO NO NO NO NO NO YES
- Summary
Retrieves attributes associated with the socket.
- Parameters
Socket is the socket to query.
Level selects the level for which an option should be queried. Valid values are: <ul> <li> osl_sol_socket: Socket Level <li> osl_sol_tcp: Level of Transmission Control Protocol </ul>
Option denotes the option to query. Valid values (depending on the Level) are: <ul> <li> osl_so_debug, <li> osl_so_acceptconn, <li> osl_so_reuseaddr, <li> osl_so_keepalive, <li> osl_so_dontroute, <li> osl_so_broadcast, <li> osl_so_useloopback, <li> osl_so_linger, <li> osl_so_oobinline, <li> osl_so_sndbuf, <li> osl_so_rcvbuf, <li> osl_so_sndlowat, <li> osl_so_rcvlowat, <li> osl_so_sndtimeo, <li> osl_so_rcvtimeo, <li> osl_so_error, <li> osl_so_type, <li> osl_so_tcp_nodelay, (sol_tcp) </ul> If not above mentioned otherwise, the options are only valid for level sol_socket.
pBuffer Pointer to a Buffer with enough room to take the desired attribute-value.
BufferSize contains the length of the Buffer.
- Return
-1 if an error occured or else the size of the data copied into pBuffer.
- osl_getSocketType
- extern "C"
oslSocketType osl_getSocketType( oslSocket Socket );
- extern "C"
virtual abstract const volatile template static inline C-linkage NO NO NO NO NO NO NO YES
- Summary
Queries the socket for its type.
- Return
one of: <ul> <li> osl_sock_stream, <li> osl_sock_dgram, <li> osl_sock_raw, <li> osl_sock_rdm, <li> osl_sock_seqpacket, <li> osl_invalid_SocketType, if an error occured </ul>
- osl_isEqualSocketAddr
- extern "C"
sal_Bool osl_isEqualSocketAddr( oslSocketAddr Addr1, oslSocketAddr Addr2 );
- extern "C"
virtual abstract const volatile template static inline C-linkage NO NO NO NO NO NO NO YES
- Summary
Compare to SocketAddress.
- osl_isExceptionPending
-
virtual abstract const volatile template static inline C-linkage NO NO NO NO NO NO NO YES
- Description
Checks if a request for out-of-band data will block. You can specify a timeout-value in seconds/microseconds that denotes how long the operation will block if the Socket has no pending OOB data.
- Return
True if OOB-request operations (recv with appropriate flags) on the Socket will NOT block; False if it would block or if an error occured.
- Parameters
Socket the Socket to perfom the operation on.
pTimeout if NULL, the operation will block without a timeout. Otherwise the time define by timeout value.
- osl_isInSocketSet
- extern "C"
sal_Bool osl_isInSocketSet( oslSocketSet Set, oslSocket Socket );
- extern "C"
virtual abstract const volatile template static inline C-linkage NO NO NO NO NO NO NO YES
- Summary
Checks if socket is in the set.
- Parameters
Set the set to be checked.
Socket check if this socket is in the set.
- Return
True if socket is in the set.
- osl_isNonBlockingMode
-
virtual abstract const volatile template static inline C-linkage NO NO NO NO NO NO NO YES
- Summary
Query state of non-blocking-mode of the socket.
- Parameters
Socket Query mode for this socket.
- Return
True if non-blocking-mode is enabled.
- osl_isReceiveReady
-
virtual abstract const volatile template static inline C-linkage NO NO NO NO NO NO NO YES
- Description
Checks if read operations will block. You can specify a timeout-value in seconds/microseconds that denotes how long the operation will block if the Socket is not ready.
- Return
True if read operations (recv, recvFrom, accept) on the Socket will NOT block; False if it would block or if an error occured.
- Parameters
Socket the Socket to perfom the operation on.
pTimeout if NULL, the operation will block without a timeout. Otherwise the time define by timeout value.
- osl_isSendReady
-
virtual abstract const volatile template static inline C-linkage NO NO NO NO NO NO NO YES
- Description
Checks if send operations will block. You can specify a timeout-value in seconds/microseconds that denotes how long the operation will block if the Socket is not ready.
- Return
True if send operations (send, sendTo) on the Socket will NOT block; False if it would block or if an error occured.
- Parameters
Socket the Socket to perfom the operation on.
pTimeout if NULL, the operation will block without a timeout. Otherwise the time define by timeout value.
- osl_listenOnSocket
-
virtual abstract const volatile template static inline C-linkage NO NO NO NO NO NO NO YES
- Summary
Prepares the socket to act as an acceptor of incoming connections. You should call "listen" before you use "accept".
- Parameters
MaxPendingConnections denotes the length of the queue of pending connections for this socket. If MaxPendingConnections is -1, the systems default value will be used (Usually 5).
- Return
False if the listen failed.
- osl_readSocket
-
virtual abstract const volatile template static inline C-linkage NO NO NO NO NO NO NO YES
- Summary
Retrieves n bytes from the stream and copies them into pBuffer. The function avoids incomplete reads due to packet boundaries.
- Parameters
pBuffer receives the read data.
n the number of bytes to read. pBuffer must be large enough to hold the n bytes!
- Return
the number of read bytes. The number will only be smaller than n if an exceptional condition (e.g. connection closed) occurs.
- osl_receiveFromSocket
- extern "C"
sal_Int32 osl_receiveFromSocket( oslSocket Socket, oslSocketAddr SenderAddr, void * pBuffer, sal_uInt32 BufferSize, oslSocketMsgFlag Flag );
- extern "C"
virtual abstract const volatile template static inline C-linkage NO NO NO NO NO NO NO YES
- Summary
Tries to receives BufferSize data from the (usually unconnected) (datagram-)socket, if no error occurs.
- Parameters
Socket A bound socket to be used to listen for a datagram.
pSenderAddr An pointer to a created oslSocketAddr handle or to a null handle. After the call, it will contain the constructed oslSocketAddr of the datagrams sender. If pSenderAddr itself is 0, it is ignored.
pBuffer Points to a buffer that will be filled with the received datagram.
BufferSize The size of pBuffer.
Flag Modifier for the call. Valid values are: <ul> <li> osl_msg_normal, <li> osl_msg_oob, <li> osl_msg_peek, <li> osl_msg_dontroute, <li> osl_msg_maxiovlen, </ul>
- Return
the number of received bytes.
- osl_receiveSocket
- extern "C"
sal_Int32 osl_receiveSocket( oslSocket Socket, void * pBuffer, sal_uInt32 BytesToRead, oslSocketMsgFlag Flag );
- extern "C"
virtual abstract const volatile template static inline C-linkage NO NO NO NO NO NO NO YES
- Description
Tries to receive BytesToRead data from the connected socket, if no error occurs. Note that incomplete recvs due to packet boundaries may occur.
- Parameters
Socket A connected socket to be used to listen on.
pBuffer Points to a buffer that will be filled with the received data.
BytesToRead The number of bytes to read. pBuffer must have at least this size.
Flag Modifier for the call. Valid values are: <ul> <li> osl_msg_normal, <li> osl_msg_oob, <li> osl_msg_peek, <li> osl_msg_dontroute, <li> osl_msg_maxiovlen, </ul>
- Return
the number of received bytes.
- osl_releaseSocket
- extern "C"
void osl_releaseSocket( oslSocket Socket );
- extern "C"
virtual abstract const volatile template static inline C-linkage NO NO NO NO NO NO NO YES
- Summary
decreases the refcount of the socket handle by one.
- Description
If the refcount drops to zero, the underlying socket handle is destroyed and becomes invalid.
- osl_removeFromSocketSet
- extern "C"
void osl_removeFromSocketSet( oslSocketSet Set, oslSocket Socket );
- extern "C"
virtual abstract const volatile template static inline C-linkage NO NO NO NO NO NO NO YES
- Summary
Removes a socket from the set.
- Parameters
Set the set were the socket is removed from.
Socket the socket to be removed.
- osl_resolveHostname
- extern "C"
oslSocketAddr osl_resolveHostname( rtl_uString * strHostname );
- extern "C"
virtual abstract const volatile template static inline C-linkage NO NO NO NO NO NO NO YES
- Summary
Uses the systems name-service interface to find an address for strHostname.
- Parameters
strHostname The name for which you search for an address.
- Return
The desired address if one could be found, otherwise 0. Don't forget to destroy the address if you don't need it any longer.
- osl_sendSocket
- extern "C"
sal_Int32 osl_sendSocket( oslSocket Socket, const void * pBuffer, sal_uInt32 BytesToSend, oslSocketMsgFlag Flag );
- extern "C"
virtual abstract const volatile template static inline C-linkage NO NO NO NO NO NO NO YES
- Summary
Tries to send BytesToSend data from the connected socket, if no error occurs.
- Parameters
Socket A connected socket.
pBuffer Points to a buffer that contains the send-data.
BytesToSend The number of bytes to send. pBuffer must have at least this size.
Flag Modifier for the call. Valid values are: <ul> <li> osl_msg_normal, <li> osl_msg_oob, <li> osl_msg_peek, <li> osl_msg_dontroute, <li> osl_msg_maxiovlen, </ul>
- Return
the number of transfered bytes.
- osl_sendToSocket
- extern "C"
sal_Int32 osl_sendToSocket( oslSocket Socket, oslSocketAddr ReceiverAddr, const void * pBuffer, sal_uInt32 BytesToSend, oslSocketMsgFlag Flag );
- extern "C"
virtual abstract const volatile template static inline C-linkage NO NO NO NO NO NO NO YES
- Description
Tries to send one datagram with BytesToSend data to the given ReceiverAddr via the (implicitly unconnected) datagram-socket. Since we only send one packet, we don't need to concern ourselfes here with incomplete sends due to packet boundaries.
- Parameters
Socket A bound or unbound socket. Socket will be bound after a successful call.
ReceiverAddr An initialized oslSocketAddress that contains the destination address for this send.
pBuffer Points to a buffer that contains the send-data.
BytesToSend The number of bytes to send. pBuffer must have at least this size.
Flag Modifier for the call. Valid values are: <ul> <li> osl_msg_normal, <li> osl_msg_oob, <li> osl_msg_peek, <li> osl_msg_dontroute, <li> osl_msg_maxiovlen, </ul>
- Return
the number of transfered bytes.
- osl_setAddrOfSocketAddr
- extern "C"
oslSocketResult osl_setAddrOfSocketAddr( oslSocketAddr Addr, sal_Sequence * pByteSeq );
- extern "C"
virtual abstract const volatile template static inline C-linkage NO NO NO NO NO NO NO YES
- Summary
Sets the addr field in the struct sockaddr with pByteSeq. pByteSeq must be in network byte order.
- osl_setInetPortOfSocketAddr
- extern "C"
sal_Bool osl_setInetPortOfSocketAddr( oslSocketAddr Addr, sal_Int32 Port );
- extern "C"
virtual abstract const volatile template static inline C-linkage NO NO NO NO NO NO NO YES
- Summary
Sets the Port of Addr.
- Parameters
Port is expected in host byte-order.
- Return
False if Addr is not an inet-addr.
- osl_setSocketOption
- extern "C"
sal_Bool osl_setSocketOption( oslSocket Socket, oslSocketOptionLevel Level, oslSocketOption Option, void * pBuffer, sal_uInt32 BufferLen );
- extern "C"
virtual abstract const volatile template static inline C-linkage NO NO NO NO NO NO NO YES
- Summary
Sets the sockets attributes.
- Parameters
Socket is the socket to modify.
Level selects the level for which an option should be changed. Valid values are: <ul> <li> osl_sol_socket: Socket Level <li> osl_sol_tcp: Level of Transmission Control Protocol </ul>
Option denotes the option to modify. Valid values (depending on the Level) are: <ul> <li> osl_so_debug, <li> osl_so_acceptconn, <li> osl_so_reuseaddr, <li> osl_so_keepalive, <li> osl_so_dontroute, <li> osl_so_broadcast, <li> osl_so_useloopback, <li> osl_so_linger, <li> osl_so_oobinline, <li> osl_so_sndbuf, <li> osl_so_rcvbuf, <li> osl_so_sndlowat, <li> osl_so_rcvlowat, <li> osl_so_sndtimeo, <li> osl_so_rcvtimeo, <li> osl_so_error, <li> osl_so_type, <li> osl_so_tcp_nodelay, (sol_tcp) </ul> If not above mentioned otherwise, the options are only valid for level sol_socket.
pBuffer Pointer to a Buffer which contains the attribute-value.
BufferSize contains the length of the Buffer.
- Return
True if the option could be changed.
- osl_shutdownSocket
- extern "C"
sal_Bool osl_shutdownSocket( oslSocket Socket, oslSocketDirection Direction );
- extern "C"
virtual abstract const volatile template static inline C-linkage NO NO NO NO NO NO NO YES
- Summary
Shuts down communication on a connected socket.
- Parameters
Direction denotes which end of the socket should be closed: <ul> <li> osl_shut_read closes read operations. <li> osl_shut_write closes write operations. <li> osl_shut_readwrite closes read and write operations. </ul>
- Return
True if the socket could be closed down.
- osl_writeSocket
-
virtual abstract const volatile template static inline C-linkage NO NO NO NO NO NO NO YES
- Summary
Writes n bytes from pBuffer to the stream. The method avoids incomplete writes due to packet boundaries.
- Parameters
pBuffer contains the data to be written.
n the number of bytes to write.
- Return
the number of written bytes. The number will only be smaller than n if an exceptional condition (e.g. connection closed) occurs.
Top of Page
Copyright 2002 Sun Microsystems, Inc., 901 San Antonio Road, Palo Alto, CA 94303 USA.