4 #ifndef INCLUDED_OSL_SOCKET_DECL_HXX 5 #define INCLUDED_OSL_SOCKET_DECL_HXX 37 #if defined LIBO_INTERNAL_ONLY 61 inline SocketAddr(const ::rtl::OUString& strAddrOrHostName, sal_Int32 nPort);
72 inline bool is()
const;
93 inline bool SAL_CALL
setHostname(const ::rtl::OUString &sDottedIpOrHostname);
99 inline sal_Int32 SAL_CALL
getPort()
const;
108 inline bool SAL_CALL
setPort(sal_Int32 nPort);
115 inline bool SAL_CALL
setAddr(const ::rtl::ByteSequence & address);
127 #if defined LIBO_INTERNAL_ONLY 163 const ::rtl::OUString & strHostName ,
SocketAddr & Addr );
172 const ::rtl::OUString& strServiceName,
173 const ::rtl::OUString & strProtocolName= ::
rtl::OUString(
"tcp") );
242 inline void SAL_CALL close();
248 inline void SAL_CALL getLocalAddr(
SocketAddr &Addr )
const;
253 inline sal_Int32 SAL_CALL getLocalPort()
const;
258 inline ::rtl::OUString SAL_CALL getLocalHost()
const;
263 inline void SAL_CALL getPeerAddr(
SocketAddr & Addr)
const;
268 inline sal_Int32 SAL_CALL getPeerPort()
const;
273 inline ::rtl::OUString SAL_CALL getPeerHost()
const;
279 inline bool SAL_CALL bind(
const SocketAddr& LocalInterface);
291 inline bool SAL_CALL isRecvReady(
const TimeValue *pTimeout = NULL)
const;
303 inline bool SAL_CALL isSendReady(
const TimeValue *pTimeout = NULL)
const;
318 inline bool SAL_CALL isExceptionPending(
const TimeValue *pTimeout = NULL)
const;
413 inline sal_Int32 SAL_CALL getOption(
416 sal_uInt32 BufferLen,
462 sal_uInt32 BufferLen,
481 inline bool SAL_CALL enableNonBlockingMode(
bool bNonBlockingMode);
486 inline bool SAL_CALL isNonBlockingMode()
const;
491 inline void SAL_CALL clearError()
const;
504 inline ::rtl::OUString getErrorAsString( )
const;
540 inline sal_Int32 SAL_CALL read(
void* pBuffer, sal_uInt32 n);
549 inline sal_Int32 SAL_CALL write(
const void* pBuffer, sal_uInt32 n);
568 inline sal_Int32 SAL_CALL recv(
void* pBuffer,
569 sal_uInt32 BytesToRead,
588 sal_Int32 SAL_CALL send(
const void* pBuffer,
589 sal_uInt32 BytesToSend,
637 inline bool SAL_CALL listen(sal_Int32 MaxPendingConnections= -1);
695 inline sal_Int32 SAL_CALL recvFrom(
void* pBuffer,
696 sal_uInt32 BufferSize,
722 inline sal_Int32 SAL_CALL sendTo(
const SocketAddr& ReceiverAddr,
724 sal_uInt32 BufferSize,
SocketAddr()
Creates socket address of unknown type.
Definition: socket.hxx:12
bool setHostname(const ::rtl::OUString &sDottedIpOrHostname)
Sets the IP address or hostname of the SocketAddress.
Definition: socket.hxx:89
oslProtocol
represent a specific protocol within an address-family
Definition: socket.h:39
oslSocketOption
Represents socket-options.
Definition: socket.h:69
inline ::rtl::OUString getHostname(oslSocketResult *pResult=NULL) const
Converts the address to a (human readable) domain-name.
Definition: socket.hxx:68
Definition: condition.hxx:11
oslSocketResult
Common return codes of socket related functions.
Definition: socket.h:177
Definition: socket_decl.hxx:512
oslAddrFamily
Represents the address-family of a socket.
Definition: socket.h:29
__osl_socket_NoCopy
Definition: socket_decl.hxx:17
SocketAddr & operator=(oslSocketAddr Addr)
assign the handle to this reference.
Definition: socket.hxx:112
oslSocketOptionLevel
Represents the different socket-option levels.
Definition: socket.h:105
Allows to accept socket connections.
Definition: socket_decl.hxx:623
oslSocketType
Represents the type of a socket.
Definition: socket.h:51
bool setAddr(const ::rtl::ByteSequence &address)
Sets the address of the underlying socket address struct in network byte order.
Definition: socket.hxx:96
__sal_NoAcquire
Definition: types.h:332
Definition: socket_decl.hxx:177
oslSocket m_handle
Definition: socket_decl.hxx:180
static inline ::rtl::OUString getLocalHostname(oslSocketResult *pResult=NULL)
Get the hostname for the local interface.
Definition: socket.hxx:164
oslSocketMsgFlag
Represents flags to be used with send/recv-calls.
Definition: socket.h:115
inline ::rtl::ByteSequence getAddr(oslSocketResult *pResult=NULL) const
Returns the address of the underlying socket in network byte order.
Definition: socket.hxx:102
static void resolveHostname(const ::rtl::OUString &strHostName, SocketAddr &Addr)
Tries to find an address for a host.
Definition: socket.hxx:173
Definition: socket_decl.hxx:593
The class should be understood as a reference to a socket address handle (struct sockaddr).
Definition: socket_decl.hxx:23
This String class provides base functionality for C++ like Unicode character array handling...
Definition: ustring.hxx:183
oslSocketError
Describes the various error socket error conditions, which may occur.
Definition: socket.h:138
bool is() const
Checks if the SocketAddr was created successful.
Definition: socket.hxx:159
oslSocketAddr m_handle
Definition: socket_decl.hxx:26
Time since Jan-01-1970.
Definition: time.h:56
SocketAddr & assign(oslSocketAddr Addr, __osl_socket_NoCopy nocopy)
Assigns the socket addr without copyconstructing it.
Definition: socket.hxx:139
A connectionless socket to send and receive datagrams.
Definition: socket_decl.hxx:663
struct oslSocketAddrImpl * oslSocketAddr
Opaque datatype SocketAddr.
Definition: socket.h:24
Definition: socket_decl.hxx:17
sal_Int32 getPort() const
Returns the port number of the address.
Definition: socket.hxx:78
oslSocketAddr getHandle() const
Returns the underlying SocketAddr handle without copyconstructing it.
Definition: socket.hxx:153
oslSocketDirection
Used by shutdown to denote which end of the socket to "close".
Definition: socket.h:128
bool operator==(oslSocketAddr Addr) const
Returns true if the underlying handle is identical to the Addr handle.
Definition: socket.hxx:148
struct oslSocketImpl * oslSocket
Definition: socket.h:195
~SocketAddr()
destroys underlying oslSocketAddress
Definition: socket.hxx:61
bool setPort(sal_Int32 nPort)
Sets the port number of the address.
Definition: socket.hxx:84
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:179