LibreOffice
LibreOffice 5.3 SDK C/C++ API Reference
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
socket.h
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3  * This file is part of the LibreOffice project.
4  *
5  * This Source Code Form is subject to the terms of the Mozilla Public
6  * License, v. 2.0. If a copy of the MPL was not distributed with this
7  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8  *
9  * This file incorporates work covered by the following license notice:
10  *
11  * Licensed to the Apache Software Foundation (ASF) under one or more
12  * contributor license agreements. See the NOTICE file distributed
13  * with this work for additional information regarding copyright
14  * ownership. The ASF licenses this file to you under the Apache
15  * License, Version 2.0 (the "License"); you may not use this file
16  * except in compliance with the License. You may obtain a copy of
17  * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18  */
19 
20 #ifndef INCLUDED_OSL_SOCKET_H
21 #define INCLUDED_OSL_SOCKET_H
22 
23 #include <rtl/ustring.h>
24 #include <rtl/byteseq.h>
25 
26 #include <osl/time.h>
27 #include <rtl/tencinfo.h>
28 
29 #ifdef __cplusplus
30 extern "C" {
31 #endif
32 
33 /* error returns */
34 #define OSL_INADDR_NONE 0xffffffff
35 #define OSL_INVALID_PORT (-1)
36 
40 typedef struct oslSocketAddrImpl * oslSocketAddr;
41 
42 
46 typedef enum {
48  osl_Socket_FamilyIpx, /* Novell IPX/SPX */
49  osl_Socket_FamilyInvalid, /* always last entry in enum! */
52 
56 typedef enum {
57  osl_Socket_ProtocolIp, /* for all af_inet */
58  osl_Socket_ProtocolIpx, /* af_ipx datagram sockets (IPX) */
59  osl_Socket_ProtocolSpx, /* af_ipx seqpacket or stream for SPX */
60  osl_Socket_ProtocolSpxII, /* af_ipx seqpacket or stream for SPX II */
63 } oslProtocol;
64 
65 
69 typedef enum {
75  osl_Socket_TypeInvalid, /* always last entry in enum! */
78 
79 
83 typedef enum {
102  osl_Socket_OptionInvalid, /* always last entry in enum! */
105 
109 typedef enum {
112  osl_Socket_LevelInvalid, /* always last entry in enum! */
115 
116 
120 typedef enum {
126  osl_Socket_MsgInvalid, /* always last entry in enum! */
129 
133 typedef enum {
137  osl_Socket_DirInvalid, /* always last entry in enum! */
140 
143 typedef enum {
144  osl_Socket_E_None, /* no error */
145  osl_Socket_E_NotSocket, /* Socket operation on non-socket */
146  osl_Socket_E_DestAddrReq, /* Destination address required */
147  osl_Socket_E_MsgSize, /* Message too long */
148  osl_Socket_E_Prototype, /* Protocol wrong type for socket */
149  osl_Socket_E_NoProtocol, /* Protocol not available */
150  osl_Socket_E_ProtocolNoSupport, /* Protocol not supported */
151  osl_Socket_E_TypeNoSupport, /* Socket type not supported */
152  osl_Socket_E_OpNotSupport, /* Operation not supported on socket */
153  osl_Socket_E_PfNoSupport, /* Protocol family not supported */
154  osl_Socket_E_AfNoSupport, /* Address family not supported by */
155  /* protocol family */
156  osl_Socket_E_AddrInUse, /* Address already in use */
157  osl_Socket_E_AddrNotAvail, /* Can't assign requested address */
158  osl_Socket_E_NetDown, /* Network is down */
159  osl_Socket_E_NetUnreachable, /* Network is unreachable */
160  osl_Socket_E_NetReset, /* Network dropped connection because */
161  /* of reset */
162  osl_Socket_E_ConnAborted, /* Software caused connection abort */
163  osl_Socket_E_ConnReset, /* Connection reset by peer */
164  osl_Socket_E_NoBufferSpace, /* No buffer space available */
165  osl_Socket_E_IsConnected, /* Socket is already connected */
166  osl_Socket_E_NotConnected, /* Socket is not connected */
167  osl_Socket_E_Shutdown, /* Can't send after socket shutdown */
168  osl_Socket_E_TooManyRefs, /* Too many references: can't splice */
169  osl_Socket_E_TimedOut, /* Connection timed out */
170  osl_Socket_E_ConnRefused, /* Connection refused */
171  osl_Socket_E_HostDown, /* Host is down */
172  osl_Socket_E_HostUnreachable, /* No route to host */
173  osl_Socket_E_WouldBlock, /* call would block on non-blocking socket */
174  osl_Socket_E_Already, /* operation already in progress */
175  osl_Socket_E_InProgress, /* operation now in progress */
176  osl_Socket_E_InvalidError, /* unmapped error: always last entry in enum! */
179 
182 typedef enum {
183  osl_Socket_Ok, /* successful completion */
184  osl_Socket_Error, /* error occurred, check osl_getLastSocketError() for details */
185  osl_Socket_TimedOut, /* blocking operation timed out */
186  osl_Socket_Interrupted, /* blocking operation was interrupted */
187  osl_Socket_InProgress, /* nonblocking operation is in progress */
190 
193 
205 SAL_DLLPUBLIC oslSocketAddr SAL_CALL osl_createEmptySocketAddr(
206  oslAddrFamily Family);
207 
208 
211 SAL_DLLPUBLIC oslSocketAddr SAL_CALL osl_copySocketAddr(
212  oslSocketAddr Addr);
213 
219  oslSocketAddr Addr1, oslSocketAddr Addr2);
220 
226 SAL_DLLPUBLIC oslSocketAddr SAL_CALL osl_resolveHostname(
227  rtl_uString *strHostname);
228 
238 SAL_DLLPUBLIC oslSocketAddr SAL_CALL osl_createInetBroadcastAddr (
239  rtl_uString *strDottedAddr, sal_Int32 Port);
240 
241 
249 SAL_DLLPUBLIC oslSocketAddr SAL_CALL osl_createInetSocketAddr (
250  rtl_uString *strDottedAddr, sal_Int32 Port);
251 
252 
257  oslSocketAddr Addr);
258 
263 SAL_DLLPUBLIC sal_Int32 SAL_CALL osl_getServicePort(
264  rtl_uString *strServicename, rtl_uString *strProtocol);
265 
266 
267 
273  oslSocketAddr Addr);
274 
275 
280 SAL_DLLPUBLIC sal_Int32 SAL_CALL osl_getInetPortOfSocketAddr(
281  oslSocketAddr Addr);
282 
283 
290  oslSocketAddr Addr, sal_Int32 Port);
291 
292 
299  oslSocketAddr Addr, rtl_uString **strHostname);
300 
301 
311  oslSocketAddr Addr, rtl_uString **strDottedInetAddr);
312 
316  oslSocketAddr Addr, sal_Sequence *pByteSeq );
317 
325  oslSocketAddr Addr, sal_Sequence **ppByteSeq );
326 
327 /*
328  Opaque datatype HostAddr.
329 */
330 typedef struct oslHostAddrImpl * oslHostAddr;
331 
332 
338 SAL_DLLPUBLIC oslHostAddr SAL_CALL osl_createHostAddr(
339  rtl_uString *strHostname, const oslSocketAddr Addr);
340 
341 
349 SAL_DLLPUBLIC oslHostAddr SAL_CALL osl_createHostAddrByName(rtl_uString *strHostname);
350 
351 
359 SAL_DLLPUBLIC oslHostAddr SAL_CALL osl_createHostAddrByAddr(const oslSocketAddr Addr);
360 
361 
365 SAL_DLLPUBLIC oslHostAddr SAL_CALL osl_copyHostAddr(const oslHostAddr Addr);
366 
367 
371 SAL_DLLPUBLIC void SAL_CALL osl_destroyHostAddr(oslHostAddr Addr);
372 
373 
377 SAL_DLLPUBLIC void SAL_CALL osl_getHostnameOfHostAddr(const oslHostAddr Addr, rtl_uString **strHostname);
378 
379 
383 SAL_DLLPUBLIC oslSocketAddr SAL_CALL osl_getSocketAddrOfHostAddr(const oslHostAddr Addr);
384 
390 SAL_DLLPUBLIC oslSocketResult SAL_CALL osl_getLocalHostname(rtl_uString **strLocalHostname);
391 
392 
400 /*-***************************************************************************/
401 /* oslSocket */
402 /*-***************************************************************************/
403 
404 typedef struct oslSocketImpl * oslSocket;
405 
408 SAL_DLLPUBLIC void SAL_CALL osl_acquireSocket( oslSocket Socket );
409 
415 SAL_DLLPUBLIC void SAL_CALL osl_releaseSocket( oslSocket Socket );
416 
422 SAL_DLLPUBLIC oslSocket SAL_CALL osl_createSocket(
423  oslAddrFamily Family,
424  oslSocketType Type,
425  oslProtocol Protocol);
426 
433 SAL_DLLPUBLIC oslSocketAddr SAL_CALL osl_getLocalAddrOfSocket(oslSocket Socket);
434 
441 SAL_DLLPUBLIC oslSocketAddr SAL_CALL osl_getPeerAddrOfSocket(oslSocket Socket);
442 
450  oslSocket Socket,
451  oslSocketAddr Addr);
452 
465  oslSocket Socket,
466  oslSocketAddr Addr,
467  const TimeValue* pTimeout);
468 
469 
479  oslSocket Socket,
480  sal_Int32 MaxPendingConnections);
481 
482 
491  (oslSocket Socket,
492  oslSocketAddr* pAddr);
493 
514 SAL_DLLPUBLIC sal_Int32 SAL_CALL osl_receiveSocket(
515  oslSocket Socket,
516  void* pBuffer,
517  sal_uInt32 BytesToRead,
518  oslSocketMsgFlag Flag);
519 
542 SAL_DLLPUBLIC sal_Int32 SAL_CALL osl_receiveFromSocket(
543  oslSocket Socket,
544  oslSocketAddr SenderAddr,
545  void* pBuffer,
546  sal_uInt32 BufferSize,
547  oslSocketMsgFlag Flag);
548 
567 SAL_DLLPUBLIC sal_Int32 SAL_CALL osl_sendSocket(
568  oslSocket Socket,
569  const void* pBuffer,
570  sal_uInt32 BytesToSend,
571  oslSocketMsgFlag Flag);
572 
598 SAL_DLLPUBLIC sal_Int32 SAL_CALL osl_sendToSocket(
599  oslSocket Socket,
600  oslSocketAddr ReceiverAddr,
601  const void* pBuffer,
602  sal_uInt32 BytesToSend,
603  oslSocketMsgFlag Flag);
604 
617  oslSocket Socket, const TimeValue* pTimeout);
618 
630  oslSocket Socket, const TimeValue* pTimeout);
631 
642  oslSocket Socket, const TimeValue* pTimeout);
643 
655 SAL_DLLPUBLIC sal_Bool SAL_CALL osl_shutdownSocket(oslSocket Socket,
656  oslSocketDirection Direction);
657 
742 SAL_DLLPUBLIC sal_Int32 SAL_CALL osl_getSocketOption( oslSocket Socket,
743  oslSocketOptionLevel Level,
744  oslSocketOption Option,
745  void* pBuffer,
746  sal_uInt32 BufferLen);
747 
768 SAL_DLLPUBLIC sal_Bool SAL_CALL osl_setSocketOption( oslSocket Socket,
769  oslSocketOptionLevel Level,
770  oslSocketOption Option,
771  void* pBuffer,
772  sal_uInt32 BufferLen);
773 
781  oslSocket Socket, sal_Bool On);
782 
783 
789  oslSocket Socket);
790 
791 
805  oslSocket Socket);
806 
812  oslSocket Socket, rtl_uString **strError);
813 
820  oslSocket Socket);
821 
824 typedef struct oslSocketSetImpl * oslSocketSet;
825 
829 SAL_DLLPUBLIC oslSocketSet SAL_CALL osl_createSocketSet(void);
830 
833 SAL_DLLPUBLIC void SAL_CALL osl_destroySocketSet(oslSocketSet Set);
834 
838 SAL_DLLPUBLIC void SAL_CALL osl_clearSocketSet(oslSocketSet Set);
839 
840 
845 SAL_DLLPUBLIC void SAL_CALL osl_addToSocketSet(oslSocketSet Set, oslSocket Socket);
846 
851 SAL_DLLPUBLIC void SAL_CALL osl_removeFromSocketSet(oslSocketSet Set, oslSocket Socket);
852 
858 SAL_DLLPUBLIC sal_Bool SAL_CALL osl_isInSocketSet(oslSocketSet Set, oslSocket Socket);
859 
875 SAL_DLLPUBLIC sal_Int32 SAL_CALL osl_demultiplexSocketEvents(oslSocketSet IncomingSet,
876  oslSocketSet OutgoingSet,
877  oslSocketSet OutOfBandSet,
878  const TimeValue* pTimeout);
879 
883 SAL_DLLPUBLIC void SAL_CALL osl_closeSocket(oslSocket Socket);
884 
885 
895 SAL_DLLPUBLIC sal_Int32 SAL_CALL osl_readSocket( oslSocket Socket, void *pBuffer, sal_Int32 nSize );
896 
897 
906 SAL_DLLPUBLIC sal_Int32 SAL_CALL osl_writeSocket( oslSocket Socket, const void *pBuffer, sal_Int32 nSize );
907 
913 #ifdef __cplusplus
914 }
915 #endif
916 
917 #endif // INCLUDED_OSL_SOCKET_H
918 
919 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Definition: socket.h:167
oslSocketOptionLevel
Represents the different socket-option levels.
Definition: socket.h:109
Definition: socket.h:165
SAL_DLLPUBLIC oslSocketResult osl_setAddrOfSocketAddr(oslSocketAddr Addr, sal_Sequence *pByteSeq)
Sets the addr field in the struct sockaddr with pByteSeq.
SAL_DLLPUBLIC void osl_clearSocketSet(oslSocketSet Set)
Clears the set from all previously added sockets.
#define SAL_DLLPUBLIC
Definition: saldllapi.h:30
struct oslSocketSetImpl * oslSocketSet
Type for the representation of socket sets.
Definition: socket.h:822
Definition: socket.h:144
SAL_DLLPUBLIC oslHostAddr osl_createHostAddrByName(rtl_uString *strHostname)
Create an oslHostAddr by resolving the given strHostname.
SAL_DLLPUBLIC sal_Int32 osl_receiveFromSocket(oslSocket Socket, oslSocketAddr SenderAddr, void *pBuffer, sal_uInt32 BufferSize, oslSocketMsgFlag Flag)
Tries to receives BufferSize data from the (usually unconnected) (datagram-)socket, if no error occurs.
Definition: socket.h:97
Definition: socket.h:102
SAL_DLLPUBLIC oslSocketResult osl_getHostnameOfSocketAddr(oslSocketAddr Addr, rtl_uString **strHostname)
Returns the hostname represented by Addr.
struct oslSocketImpl * oslSocket
Definition: socket.h:402
SAL_DLLPUBLIC oslSocketAddr osl_getLocalAddrOfSocket(oslSocket Socket)
Retrieves the Address of the local end of the socket.
Definition: socket.h:126
Definition: socket.h:87
SAL_DLLPUBLIC void osl_destroySocketSet(oslSocketSet Set)
Destroys a oslSocketSet.
Definition: socket.h:186
sal_uInt8 oslSocketIpxNodeNumber[6]
Definition: socket.h:192
Definition: socket.h:147
Definition: socket.h:61
Definition: socket.h:90
SAL_DLLPUBLIC sal_Int32 osl_sendSocket(oslSocket Socket, const void *pBuffer, sal_uInt32 BytesToSend, oslSocketMsgFlag Flag)
Tries to send BytesToSend data from the connected socket, if no error occurs.
SAL_DLLPUBLIC sal_Bool osl_isInSocketSet(oslSocketSet Set, oslSocket Socket)
Checks if socket is in the set.
oslSocketOption
Represents socket-options.
Definition: socket.h:83
SAL_DLLPUBLIC oslSocketResult osl_getAddrOfSocketAddr(oslSocketAddr Addr, sal_Sequence **ppByteSeq)
Returns the addr field in the struct sockaddr.
SAL_DLLPUBLIC void osl_removeFromSocketSet(oslSocketSet Set, oslSocket Socket)
Removes a socket from the set.
Definition: socket.h:158
oslSocketDirection
Used by shutdown to denote which end of the socket to &quot;close&quot;.
Definition: socket.h:133
Definition: socket.h:94
Definition: socket.h:153
Definition: socket.h:177
Definition: socket.h:135
Definition: socket.h:156
Definition: socket.h:112
SAL_DLLPUBLIC oslSocketError osl_getLastSocketError(oslSocket Socket)
returns a constant describing the last error for the socket system.
SAL_DLLPUBLIC oslSocketSet osl_createSocketSet(void)
Creates a set of sockets to be used with osl_demultiplexSocketEvents().
Definition: socket.h:168
SAL_DLLPUBLIC oslSocketAddr osl_getPeerAddrOfSocket(oslSocket Socket)
Retrieves the Address of the remote end of the socket.
Definition: socket.h:145
SAL_DLLPUBLIC void osl_getHostnameOfHostAddr(const oslHostAddr Addr, rtl_uString **strHostname)
Get the hostname member of Addr.
Definition: socket.h:137
#define SAL_MAX_ENUM
Definition: types.h:242
struct oslHostAddrImpl * oslHostAddr
Definition: socket.h:329
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
Definition: socket.h:110
Definition: socket.h:72
SAL_DLLPUBLIC oslSocketResult osl_getDottedInetAddrOfSocketAddr(oslSocketAddr Addr, rtl_uString **strDottedInetAddr)
Gets the address in dotted decimal format.
Definition: socket.h:95
unsigned char sal_Bool
Definition: types.h:48
oslSocketMsgFlag
Represents flags to be used with send/recv-calls.
Definition: socket.h:120
unsigned char sal_uInt8
Definition: types.h:54
SAL_DLLPUBLIC void osl_closeSocket(oslSocket Socket)
Closes the socket terminating any ongoing dataflow.
Definition: socket.h:57
sal_uInt8 oslSocketIpxNetNumber[4]
Definition: socket.h:191
Definition: socket.h:123
Definition: socket.h:48
SAL_DLLPUBLIC oslSocketAddr osl_createInetBroadcastAddr(rtl_uString *strDottedAddr, sal_Int32 Port)
Create an internet address usable for sending broadcast datagrams.
SAL_DLLPUBLIC sal_Int32 osl_writeSocket(oslSocket Socket, const void *pBuffer, sal_Int32 nSize)
Writes n bytes from pBuffer to the stream.
SAL_DLLPUBLIC oslHostAddr osl_createHostAddr(rtl_uString *strHostname, const oslSocketAddr Addr)
Create an oslHostAddr from given hostname and socket address.
SAL_DLLPUBLIC sal_Bool osl_bindAddrToSocket(oslSocket Socket, oslSocketAddr Addr)
Binds the given address to the socket.
Definition: socket.h:162
Definition: socket.h:173
SAL_DLLPUBLIC sal_Bool osl_listenOnSocket(oslSocket Socket, sal_Int32 MaxPendingConnections)
Prepares the socket to act as an acceptor of incoming connections.
Definition: socket.h:127
Definition: socket.h:99
Definition: socket.h:98
struct oslSocketAddrImpl * oslSocketAddr
Opaque datatype SocketAddr.
Definition: socket.h:40
oslSocketResult
Common return codes of socket related functions.
Definition: socket.h:182
Definition: socket.h:121
Definition: socket.h:92
SAL_DLLPUBLIC void osl_releaseSocket(oslSocket Socket)
decreases the refcount of the socket handle by one.
Definition: socket.h:157
Definition: socket.h:76
SAL_DLLPUBLIC sal_Int32 osl_sendToSocket(oslSocket Socket, oslSocketAddr ReceiverAddr, const void *pBuffer, sal_uInt32 BytesToSend, oslSocketMsgFlag Flag)
Tries to send one datagram with BytesToSend data to the given ReceiverAddr via the (implicitly unconn...
SAL_DLLPUBLIC sal_Bool osl_isEqualSocketAddr(oslSocketAddr Addr1, oslSocketAddr Addr2)
Compares the values of two SocketAddresses.
Definition: socket.h:176
Definition: socket.h:171
Definition: socket.h:159
SAL_DLLPUBLIC sal_Int32 osl_readSocket(oslSocket Socket, void *pBuffer, sal_Int32 nSize)
Retrieves n bytes from the stream and copies them into pBuffer.
Definition: socket.h:60
Definition: socket.h:88
SAL_DLLPUBLIC oslSocketResult osl_connectSocketTo(oslSocket Socket, oslSocketAddr Addr, const TimeValue *pTimeout)
Connects the socket to the given address.
Definition: socket.h:160
Definition: socket.h:113
Definition: socket.h:86
SAL_DLLPUBLIC sal_Bool osl_isSendReady(oslSocket Socket, const TimeValue *pTimeout)
Checks if send operations will block.
SAL_DLLPUBLIC sal_Bool osl_enableNonBlockingMode(oslSocket Socket, sal_Bool On)
Enables/disables non-blocking-mode of the socket.
SAL_DLLPUBLIC sal_Int32 osl_getSocketOption(oslSocket Socket, oslSocketOptionLevel Level, oslSocketOption Option, void *pBuffer, sal_uInt32 BufferLen)
Retrieves attributes associated with the socket.
Definition: socket.h:91
Definition: socket.h:175
Definition: socket.h:122
SAL_DLLPUBLIC void osl_getLastSocketErrorDescription(oslSocket Socket, rtl_uString **strError)
returns a string which describes the last socket error.
SAL_DLLPUBLIC sal_Bool osl_isNonBlockingMode(oslSocket Socket)
Query state of non-blocking-mode of the socket.
SAL_DLLPUBLIC sal_Bool osl_shutdownSocket(oslSocket Socket, oslSocketDirection Direction)
Shuts down communication on a connected socket.
Definition: socket.h:74
SAL_DLLPUBLIC oslSocketAddr osl_getSocketAddrOfHostAddr(const oslHostAddr Addr)
Get the socket address member of Addr.
Definition: socket.h:134
SAL_DLLPUBLIC sal_Bool osl_isReceiveReady(oslSocket Socket, const TimeValue *pTimeout)
Checks if read operations will block.
SAL_DLLPUBLIC void osl_destroySocketAddr(oslSocketAddr Addr)
Frees all resources allocated by Addr.
SAL_DLLPUBLIC oslHostAddr osl_createHostAddrByAddr(const oslSocketAddr Addr)
Create an oslHostAddr by reverse resolution of the given Addr.
Definition: socket.h:59
Definition: socket.h:174
Definition: socket.h:169
SAL_DLLPUBLIC sal_Bool osl_setInetPortOfSocketAddr(oslSocketAddr Addr, sal_Int32 Port)
Sets the Port of Addr.
SAL_DLLPUBLIC oslSocketAddr osl_createEmptySocketAddr(oslAddrFamily Family)
Creates a socket-address for the given family.
oslProtocol
represent a specific protocol within a address-family
Definition: socket.h:56
Definition: socket.h:148
Definition: socket.h:170
SAL_DLLPUBLIC void osl_acquireSocket(oslSocket Socket)
increases the refcount of the socket handle by one
SAL_DLLPUBLIC oslSocketResult osl_getLocalHostname(rtl_uString **strLocalHostname)
Retrieve this machines hostname.
Definition: socket.h:185
SAL_DLLPUBLIC sal_Int32 osl_receiveSocket(oslSocket Socket, void *pBuffer, sal_uInt32 BytesToRead, oslSocketMsgFlag Flag)
Tries to receive BytesToRead data from the connected socket, if no error occurs.
This is the binary specification of a SAL sequence.
Definition: types.h:345
Definition: socket.h:101
Definition: socket.h:166
Definition: socket.h:49
Definition: socket.h:124
Definition: socket.h:187
SAL_DLLPUBLIC oslSocketAddr osl_resolveHostname(rtl_uString *strHostname)
Uses the systems name-service interface to find an address for strHostname.
SAL_DLLPUBLIC sal_Bool osl_isExceptionPending(oslSocket Socket, const TimeValue *pTimeout)
Checks if a request for out-of-band data will block.
Definition: socket.h:149
Definition: time.h:70
Definition: socket.h:84
SAL_DLLPUBLIC oslSocketType osl_getSocketType(oslSocket Socket)
Queries the socket for its type.
Definition: socket.h:103
SAL_DLLPUBLIC oslAddrFamily osl_getFamilyOfSocketAddr(oslSocketAddr Addr)
Retrieves the address-family from the Addr.
Definition: socket.h:172
SAL_DLLPUBLIC void osl_destroyHostAddr(oslHostAddr Addr)
Frees all resources allocated by Addr.
Definition: socket.h:73
Definition: socket.h:89
Definition: socket.h:136
Definition: socket.h:151
SAL_DLLPUBLIC oslSocketAddr osl_copySocketAddr(oslSocketAddr Addr)
Creates a new SocketAddress and fills it from Addr.
SAL_DLLPUBLIC sal_Int32 osl_getServicePort(rtl_uString *strServicename, rtl_uString *strProtocol)
Looks up the port-number designated to the specified service/protocol-pair.
Definition: socket.h:183
Definition: socket.h:146
SAL_DLLPUBLIC oslSocket osl_acceptConnectionOnSocket(oslSocket Socket, oslSocketAddr *pAddr)
Waits for an ingoing connection on the socket.
Definition: socket.h:85
Definition: socket.h:47
Definition: socket.h:150
SAL_DLLPUBLIC oslSocketAddr osl_createInetSocketAddr(rtl_uString *strDottedAddr, sal_Int32 Port)
Create an internet-address, consisting of hostaddress and port.
Definition: socket.h:96
Definition: socket.h:184
Definition: socket.h:138
SAL_DLLPUBLIC void osl_addToSocketSet(oslSocketSet Set, oslSocket Socket)
Adds a socket to the set.
Definition: socket.h:152
Definition: socket.h:70
Definition: socket.h:93
Definition: socket.h:100
Definition: socket.h:188
oslAddrFamily
Represents the address-family of a socket.
Definition: socket.h:46
SAL_DLLPUBLIC sal_Int32 osl_demultiplexSocketEvents(oslSocketSet IncomingSet, oslSocketSet OutgoingSet, oslSocketSet OutOfBandSet, const TimeValue *pTimeout)
Checks multiple sockets for events.
SAL_DLLPUBLIC oslHostAddr osl_copyHostAddr(const oslHostAddr Addr)
Create a copy of the given Addr.
Definition: socket.h:111
Definition: socket.h:71
Definition: socket.h:163
Definition: socket.h:58
Definition: socket.h:164
SAL_DLLPUBLIC sal_Bool osl_setSocketOption(oslSocket Socket, oslSocketOptionLevel Level, oslSocketOption Option, void *pBuffer, sal_uInt32 BufferLen)
Sets the sockets attributes.
SAL_DLLPUBLIC oslSocket osl_createSocket(oslAddrFamily Family, oslSocketType Type, oslProtocol Protocol)
Create a socket of the specified Family and Type.
Definition: socket.h:125
Definition: socket.h:75
Definition: socket.h:50
Definition: socket.h:154
SAL_DLLPUBLIC sal_Int32 osl_getInetPortOfSocketAddr(oslSocketAddr Addr)
Retrieves the internet port-number of Addr.