20 #ifndef INCLUDED_OSL_SOCKET_DECL_HXX 21 #define INCLUDED_OSL_SOCKET_DECL_HXX 65 inline SocketAddr( const ::rtl::OUString& strAddrOrHostName, sal_Int32 nPort );
75 inline bool is()
const;
89 inline bool SAL_CALL
setHostname( const ::rtl::OUString &sDottedIpOrHostname );
94 inline sal_Int32 SAL_CALL
getPort()
const;
99 inline bool SAL_CALL
setPort( sal_Int32 nPort );
104 inline bool SAL_CALL
setAddr( const ::rtl::ByteSequence & address );
148 const ::rtl::OUString & strHostName ,
SocketAddr & Addr );
157 const ::rtl::OUString& strServiceName,
158 const ::rtl::OUString & strProtocolName= ::
rtl::OUString(
"tcp") );
227 inline void SAL_CALL close();
233 inline void SAL_CALL getLocalAddr(
SocketAddr &Addr )
const;
238 inline sal_Int32 SAL_CALL getLocalPort()
const;
243 inline ::rtl::OUString SAL_CALL getLocalHost()
const;
248 inline void SAL_CALL getPeerAddr(
SocketAddr & Addr)
const;
253 inline sal_Int32 SAL_CALL getPeerPort()
const;
258 inline ::rtl::OUString SAL_CALL getPeerHost()
const;
264 inline bool SAL_CALL bind(
const SocketAddr& LocalInterface);
276 inline bool SAL_CALL isRecvReady(
const TimeValue *pTimeout = 0)
const;
288 inline bool SAL_CALL isSendReady(
const TimeValue *pTimeout = 0)
const;
303 inline bool SAL_CALL isExceptionPending(
const TimeValue *pTimeout = 0)
const;
400 inline sal_Int32 SAL_CALL getOption(
403 sal_uInt32 BufferLen,
449 sal_uInt32 BufferLen,
468 inline bool SAL_CALL enableNonBlockingMode(
bool bNonBlockingMode);
473 inline bool SAL_CALL isNonBlockingMode()
const;
478 inline void SAL_CALL clearError()
const;
491 inline ::rtl::OUString getErrorAsString( )
const;
529 inline sal_Int32 SAL_CALL read(
void* pBuffer, sal_uInt32 n);
538 inline sal_Int32 SAL_CALL write(
const void* pBuffer, sal_uInt32 n);
557 inline sal_Int32 SAL_CALL recv(
void* pBuffer,
558 sal_uInt32 BytesToRead,
577 sal_Int32 SAL_CALL send(
const void* pBuffer,
578 sal_uInt32 BytesToSend,
626 inline bool SAL_CALL listen(sal_Int32 MaxPendingConnections= -1);
685 inline sal_Int32 SAL_CALL recvFrom(
void* pBuffer,
686 sal_uInt32 BufferSize,
712 inline sal_Int32 SAL_CALL sendTo(
const SocketAddr& ReceiverAddr,
714 sal_uInt32 BufferSize,
oslSocketOptionLevel
Represents the different socket-option levels.
Definition: socket.h:109
inline::rtl::OUString getHostname(oslSocketResult *pResult=0) const
Converts the address to a (human readable) domain-name.
Definition: socket.hxx:78
bool operator==(oslSocketAddr Addr) const
Returns true if the underlying handle is identical to the Addr handle.
Definition: socket.hxx:147
struct oslSocketImpl * oslSocket
Definition: socket.h:402
SocketAddr & assign(oslSocketAddr Addr, __osl_socket_NoCopy nocopy)
Assigns the socket addr without copyconstructing it.
Definition: socket.hxx:138
bool setAddr(const ::rtl::ByteSequence &address)
Sets the address of the underlying socket address struct in network byte order.
Definition: socket.hxx:106
SocketAddr()
Creates socket address of unknown type.
Definition: socket.hxx:27
oslSocketOption
Represents socket-options.
Definition: socket.h:83
oslSocketDirection
Used by shutdown to denote which end of the socket to "close".
Definition: socket.h:133
~SocketAddr()
destroys underlying oslSocketAddress
Definition: socket.hxx:71
static void resolveHostname(const ::rtl::OUString &strHostName, SocketAddr &Addr)
Tries to find an address for a host.
Definition: socket.hxx:174
bool setHostname(const ::rtl::OUString &sDottedIpOrHostname)
Sets the ipaddress or hostname of the SocketAddress.
Definition: socket.hxx:99
oslSocketAddr getHandle() const
Returns the underlying SocketAddr handle without copyconstructing it.
Definition: socket.hxx:152
static inline::rtl::OUString getLocalHostname(oslSocketResult *pResult=0)
Get the hostname for the local interface.
Definition: socket.hxx:164
oslSocketType
Represents the type of a socket.
Definition: socket.h:69
oslSocketError
Describes the various error socket error conditions, which may occur.
Definition: socket.h:143
oslSocketMsgFlag
Represents flags to be used with send/recv-calls.
Definition: socket.h:120
struct oslSocketAddrImpl * oslSocketAddr
Opaque datatype SocketAddr.
Definition: socket.h:40
oslSocketResult
Common return codes of socket related functions.
Definition: socket.h:182
__sal_NoAcquire
Definition: types.h:378
Allows to accept socket connections.
Definition: socket_decl.hxx:612
Definition: socket_decl.hxx:582
oslProtocol
represent a specific protocol within a address-family
Definition: socket.h:56
oslSocketAddr m_handle
Definition: socket_decl.hxx:38
__osl_socket_NoCopy
Definition: socket_decl.hxx:29
sal_Int32 getPort() const
Returns the port number of the address.
Definition: socket.hxx:88
This String class provides base functionality for C++ like Unicode character array handling...
Definition: ustring.hxx:115
The class should be understood as a reference to a socket address handle ( struct sockaddr )...
Definition: socket_decl.hxx:35
bool setPort(sal_Int32 nPort)
Sets the port number of the address.
Definition: socket.hxx:94
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:181
oslSocket m_handle
Definition: socket_decl.hxx:165
Definition: socket_decl.hxx:499
Definition: conditn.hxx:28
SocketAddr & operator=(oslSocketAddr Addr)
assign the handle to this reference.
Definition: socket.hxx:122
oslAddrFamily
Represents the address-family of a socket.
Definition: socket.h:46
inline::rtl::ByteSequence getAddr(oslSocketResult *pResult=0) const
Returns the address of the underlying socket in network byte order.
Definition: socket.hxx:112
Definition: socket_decl.hxx:162
bool is() const
checks, if the SocketAddr was created successful.
Definition: socket.hxx:158
A connectionless socket to send and receive datagrams.
Definition: socket_decl.hxx:653
Definition: socket_decl.hxx:29