20 #ifndef INCLUDED_OSL_SOCKET_DECL_HXX 21 #define INCLUDED_OSL_SOCKET_DECL_HXX 53 #if defined LIBO_INTERNAL_ONLY 73 inline SocketAddr( const ::rtl::OUString& strAddrOrHostName, sal_Int32 nPort );
83 inline bool is()
const;
97 inline bool SAL_CALL
setHostname( const ::rtl::OUString &sDottedIpOrHostname );
102 inline sal_Int32 SAL_CALL
getPort()
const;
107 inline bool SAL_CALL
setPort( sal_Int32 nPort );
112 inline bool SAL_CALL
setAddr( const ::rtl::ByteSequence & address );
124 #if defined LIBO_INTERNAL_ONLY 158 const ::rtl::OUString & strHostName ,
SocketAddr & Addr );
167 const ::rtl::OUString& strServiceName,
168 const ::rtl::OUString & strProtocolName= ::
rtl::OUString(
"tcp") );
237 inline void SAL_CALL close();
243 inline void SAL_CALL getLocalAddr(
SocketAddr &Addr )
const;
248 inline sal_Int32 SAL_CALL getLocalPort()
const;
253 inline ::rtl::OUString SAL_CALL getLocalHost()
const;
258 inline void SAL_CALL getPeerAddr(
SocketAddr & Addr)
const;
263 inline sal_Int32 SAL_CALL getPeerPort()
const;
268 inline ::rtl::OUString SAL_CALL getPeerHost()
const;
274 inline bool SAL_CALL bind(
const SocketAddr& LocalInterface);
286 inline bool SAL_CALL isRecvReady(
const TimeValue *pTimeout = NULL)
const;
298 inline bool SAL_CALL isSendReady(
const TimeValue *pTimeout = NULL)
const;
313 inline bool SAL_CALL isExceptionPending(
const TimeValue *pTimeout = NULL)
const;
410 inline sal_Int32 SAL_CALL getOption(
413 sal_uInt32 BufferLen,
459 sal_uInt32 BufferLen,
478 inline bool SAL_CALL enableNonBlockingMode(
bool bNonBlockingMode);
483 inline bool SAL_CALL isNonBlockingMode()
const;
488 inline void SAL_CALL clearError()
const;
501 inline ::rtl::OUString getErrorAsString( )
const;
539 inline sal_Int32 SAL_CALL read(
void* pBuffer, sal_uInt32 n);
548 inline sal_Int32 SAL_CALL write(
const void* pBuffer, sal_uInt32 n);
567 inline sal_Int32 SAL_CALL recv(
void* pBuffer,
568 sal_uInt32 BytesToRead,
587 sal_Int32 SAL_CALL send(
const void* pBuffer,
588 sal_uInt32 BytesToSend,
636 inline bool SAL_CALL listen(sal_Int32 MaxPendingConnections= -1);
694 inline sal_Int32 SAL_CALL recvFrom(
void* pBuffer,
695 sal_uInt32 BufferSize,
721 inline sal_Int32 SAL_CALL sendTo(
const SocketAddr& ReceiverAddr,
723 sal_uInt32 BufferSize,
~SocketAddr()
destroys underlying oslSocketAddress
Definition: socket.hxx:76
SocketAddr & assign(oslSocketAddr Addr, __osl_socket_NoCopy nocopy)
Assigns the socket addr without copyconstructing it.
Definition: socket.hxx:154
bool setPort(sal_Int32 nPort)
Sets the port number of the address.
Definition: socket.hxx:99
oslSocketAddr getHandle() const
Returns the underlying SocketAddr handle without copyconstructing it.
Definition: socket.hxx:168
SocketAddr()
Creates socket address of unknown type.
Definition: socket.hxx:27
bool operator==(oslSocketAddr Addr) const
Returns true if the underlying handle is identical to the Addr handle.
Definition: socket.hxx:163
oslSocketMsgFlag
Represents flags to be used with send/recv-calls.
Definition: socket.h:120
bool setAddr(const ::rtl::ByteSequence &address)
Sets the address of the underlying socket address struct in network byte order.
Definition: socket.hxx:111
oslSocketError
Describes the various error socket error conditions, which may occur.
Definition: socket.h:143
static sal_Int32 getServicePort(const ::rtl::OUString &strServiceName, const ::rtl::OUString &strProtocolName=::rtl::OUString("tcp"))
Tries to find the port associated with the given service/protocol- pair (e.g.
Definition: socket.hxx:194
static inline ::rtl::OUString getLocalHostname(oslSocketResult *pResult=NULL)
Get the hostname for the local interface.
Definition: socket.hxx:179
inline ::rtl::OUString getHostname(oslSocketResult *pResult=NULL) const
Converts the address to a (human readable) domain-name.
Definition: socket.hxx:83
struct oslSocketImpl * oslSocket
Definition: socket.h:405
inline ::rtl::ByteSequence getAddr(oslSocketResult *pResult=NULL) const
Returns the address of the underlying socket in network byte order.
Definition: socket.hxx:117
struct oslSocketAddrImpl * oslSocketAddr
Opaque datatype SocketAddr.
Definition: socket.h:40
oslSocketAddr m_handle
Definition: socket_decl.hxx:42
oslSocketDirection
Used by shutdown to denote which end of the socket to "close".
Definition: socket.h:133
__osl_socket_NoCopy
Definition: socket_decl.hxx:33
oslProtocol
represent a specific protocol within a address-family
Definition: socket.h:56
sal_Int32 getPort() const
Returns the port number of the address.
Definition: socket.hxx:93
__sal_NoAcquire
Definition: types.h:366
oslSocketOption
Represents socket-options.
Definition: socket.h:83
Definition: socket_decl.hxx:592
bool is() const
checks, if the SocketAddr was created successful.
Definition: socket.hxx:174
Definition: conditn.hxx:37
SocketAddr & operator=(oslSocketAddr Addr)
assign the handle to this reference.
Definition: socket.hxx:127
oslAddrFamily
Represents the address-family of a socket.
Definition: socket.h:46
Definition: socket_decl.hxx:33
oslSocket m_handle
Definition: socket_decl.hxx:175
The class should be understood as a reference to a socket address handle ( struct sockaddr )...
Definition: socket_decl.hxx:39
This String class provides base functionality for C++ like Unicode character array handling...
Definition: ustring.hxx:120
oslSocketOptionLevel
Represents the different socket-option levels.
Definition: socket.h:109
oslSocketResult
Common return codes of socket related functions.
Definition: socket.h:182
A connectionless socket to send and receive datagrams.
Definition: socket_decl.hxx:662
Definition: socket_decl.hxx:509
bool setHostname(const ::rtl::OUString &sDottedIpOrHostname)
Sets the ipaddress or hostname of the SocketAddress.
Definition: socket.hxx:104
static void resolveHostname(const ::rtl::OUString &strHostName, SocketAddr &Addr)
Tries to find an address for a host.
Definition: socket.hxx:188
Allows to accept socket connections.
Definition: socket_decl.hxx:622
Definition: socket_decl.hxx:172
oslSocketType
Represents the type of a socket.
Definition: socket.h:69