LibreOffice LibreOffice 4.1 SDK C/C++ API Reference

- Main Page
- Related Pages
- Namespaces
- Classes
- Files

- File List
- File Members

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 _OSL_SOCKET_H_
21 #define _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 #define OSL_INVALID_IPX_SOCKET_NO 0xffffffff
37
41 typedef struct oslSocketAddrImpl * oslSocketAddr;
42
43
47 typedef enum {
48 osl_Socket_FamilyInet, /* IP */
49 osl_Socket_FamilyIpx, /* Novell IPX/SPX */
50 osl_Socket_FamilyInvalid, /* always last entry in enum! */
51 osl_Socket_Family_FORCE_EQUAL_SIZE = SAL_MAX_ENUM
52 } oslAddrFamily;
53
57 typedef enum {
58 osl_Socket_ProtocolIp, /* for all af_inet */
59 osl_Socket_ProtocolIpx, /* af_ipx datagram sockets (IPX) */
60 osl_Socket_ProtocolSpx, /* af_ipx seqpacket or stream for SPX */
61 osl_Socket_ProtocolSpxII, /* af_ipx seqpacket or stream for SPX II */
62 osl_Socket_ProtocolInvalid,
63 osl_Socket_Protocol_FORCE_EQUAL_SIZE = SAL_MAX_ENUM
64 } oslProtocol;
65
66
70 typedef enum {
71 osl_Socket_TypeStream,
72 osl_Socket_TypeDgram,
73 osl_Socket_TypeRaw,
74 osl_Socket_TypeRdm,
75 osl_Socket_TypeSeqPacket,
76 osl_Socket_TypeInvalid, /* always last entry in enum! */
77 osl_Socket_Type_FORCE_EQUAL_SIZE = SAL_MAX_ENUM
78 } oslSocketType;
79
80
84 typedef enum {
85 osl_Socket_OptionDebug,
86 osl_Socket_OptionAcceptConn,
87 osl_Socket_OptionReuseAddr,
88 osl_Socket_OptionKeepAlive,
89 osl_Socket_OptionDontRoute,
90 osl_Socket_OptionBroadcast,
91 osl_Socket_OptionUseLoopback,
92 osl_Socket_OptionLinger,
93 osl_Socket_OptionOOBinLine,
94 osl_Socket_OptionSndBuf,
95 osl_Socket_OptionRcvBuf,
96 osl_Socket_OptionSndLowat,
97 osl_Socket_OptionRcvLowat,
98 osl_Socket_OptionSndTimeo,
99 osl_Socket_OptionRcvTimeo,
100 osl_Socket_OptionError,
101 osl_Socket_OptionType,
102 osl_Socket_OptionTcpNoDelay,
103 osl_Socket_OptionInvalid, /* always last entry in enum! */
104 osl_Socket_Option_FORCE_EQUAL_SIZE = SAL_MAX_ENUM
105 } oslSocketOption;
106
110 typedef enum {
111 osl_Socket_LevelSocket,
112 osl_Socket_LevelTcp,
113 osl_Socket_LevelInvalid, /* always last entry in enum! */
114 osl_Socket_Level_FORCE_EQUAL_SIZE = SAL_MAX_ENUM
115 } oslSocketOptionLevel;
116
117
121 typedef enum {
122 osl_Socket_MsgNormal,
123 osl_Socket_MsgOOB,
124 osl_Socket_MsgPeek,
125 osl_Socket_MsgDontRoute,
126 osl_Socket_MsgMaxIOVLen,
127 osl_Socket_MsgInvalid, /* always last entry in enum! */
128 osl_Socket_Msg_FORCE_EQUAL_SIZE = SAL_MAX_ENUM
129 } oslSocketMsgFlag;
130
134 typedef enum {
135 osl_Socket_DirRead,
136 osl_Socket_DirWrite,
137 osl_Socket_DirReadWrite,
138 osl_Socket_DirInvalid, /* always last entry in enum! */
139 osl_Socket_Dir_FORCE_EQUAL_SIZE = SAL_MAX_ENUM
140 } oslSocketDirection;
141
144 typedef enum {
145 osl_Socket_E_None, /* no error */
146 osl_Socket_E_NotSocket, /* Socket operation on non-socket */
147 osl_Socket_E_DestAddrReq, /* Destination address required */
148 osl_Socket_E_MsgSize, /* Message too long */
149 osl_Socket_E_Prototype, /* Protocol wrong type for socket */
150 osl_Socket_E_NoProtocol, /* Protocol not available */
151 osl_Socket_E_ProtocolNoSupport, /* Protocol not supported */
152 osl_Socket_E_TypeNoSupport, /* Socket type not supported */
153 osl_Socket_E_OpNotSupport, /* Operation not supported on socket */
154 osl_Socket_E_PfNoSupport, /* Protocol family not supported */
155 osl_Socket_E_AfNoSupport, /* Address family not supported by */
156 /* protocol family */
157 osl_Socket_E_AddrInUse, /* Address already in use */
158 osl_Socket_E_AddrNotAvail, /* Can't assign requested address */
159 osl_Socket_E_NetDown, /* Network is down */
160 osl_Socket_E_NetUnreachable, /* Network is unreachable */
161 osl_Socket_E_NetReset, /* Network dropped connection because */
162 /* of reset */
163 osl_Socket_E_ConnAborted, /* Software caused connection abort */
164 osl_Socket_E_ConnReset, /* Connection reset by peer */
165 osl_Socket_E_NoBufferSpace, /* No buffer space available */
166 osl_Socket_E_IsConnected, /* Socket is already connected */
167 osl_Socket_E_NotConnected, /* Socket is not connected */
168 osl_Socket_E_Shutdown, /* Can't send after socket shutdown */
169 osl_Socket_E_TooManyRefs, /* Too many references: can't splice */
170 osl_Socket_E_TimedOut, /* Connection timed out */
171 osl_Socket_E_ConnRefused, /* Connection refused */
172 osl_Socket_E_HostDown, /* Host is down */
173 osl_Socket_E_HostUnreachable, /* No route to host */
174 osl_Socket_E_WouldBlock, /* call would block on non-blocking socket */
175 osl_Socket_E_Already, /* operation already in progress */
176 osl_Socket_E_InProgress, /* operation now in progress */
177 osl_Socket_E_InvalidError, /* unmapped error: always last entry in enum! */
178 osl_Socket_E_FORCE_EQUAL_SIZE = SAL_MAX_ENUM
179 } oslSocketError;
180
183 typedef enum {
184 osl_Socket_Ok, /* successful completion */
185 osl_Socket_Error, /* error occurred, check osl_getLastSocketError() for details */
186 osl_Socket_TimedOut, /* blocking operation timed out */
187 osl_Socket_Interrupted, /* blocking operation was interrupted */
188 osl_Socket_InProgress, /* nonblocking operation is in progress */
189 osl_Socket_FORCE_EQUAL_SIZE = SAL_MAX_ENUM
190 } oslSocketResult;
191
192 typedef sal_uInt8 oslSocketIpxNetNumber[4];
193 typedef sal_uInt8 oslSocketIpxNodeNumber[6];
194
206 SAL_DLLPUBLIC oslSocketAddr SAL_CALL osl_createEmptySocketAddr(
207 oslAddrFamily Family);
208
209
212 SAL_DLLPUBLIC oslSocketAddr SAL_CALL osl_copySocketAddr(
213 oslSocketAddr Addr);
214
219 SAL_DLLPUBLIC sal_Bool SAL_CALL osl_isEqualSocketAddr(
220 oslSocketAddr Addr1, oslSocketAddr Addr2);
221
227 SAL_DLLPUBLIC oslSocketAddr SAL_CALL osl_resolveHostname(
228 rtl_uString *strHostname);
229
239 SAL_DLLPUBLIC oslSocketAddr SAL_CALL osl_createInetBroadcastAddr (
240 rtl_uString *strDottedAddr, sal_Int32 Port);
241
242
250 SAL_DLLPUBLIC oslSocketAddr SAL_CALL osl_createInetSocketAddr (
251 rtl_uString *strDottedAddr, sal_Int32 Port);
252
253
257 SAL_DLLPUBLIC void SAL_CALL osl_destroySocketAddr(
258 oslSocketAddr Addr);
259
264 SAL_DLLPUBLIC sal_Int32 SAL_CALL osl_getServicePort(
265 rtl_uString *strServicename, rtl_uString *strProtocol);
266
267
268
273 SAL_DLLPUBLIC oslAddrFamily SAL_CALL osl_getFamilyOfSocketAddr(
274 oslSocketAddr Addr);
275
276
281 SAL_DLLPUBLIC sal_Int32 SAL_CALL osl_getInetPortOfSocketAddr(
282 oslSocketAddr Addr);
283
284
290 SAL_DLLPUBLIC sal_Bool SAL_CALL osl_setInetPortOfSocketAddr(
291 oslSocketAddr Addr, sal_Int32 Port);
292
293
299 SAL_DLLPUBLIC oslSocketResult SAL_CALL osl_getHostnameOfSocketAddr(
300 oslSocketAddr Addr, rtl_uString **strHostname);
301
302
311 SAL_DLLPUBLIC oslSocketResult SAL_CALL osl_getDottedInetAddrOfSocketAddr(
312 oslSocketAddr Addr, rtl_uString **strDottedInetAddr);
313
316 SAL_DLLPUBLIC oslSocketResult SAL_CALL osl_setAddrOfSocketAddr(
317 oslSocketAddr Addr, sal_Sequence *pByteSeq );
318
325 SAL_DLLPUBLIC oslSocketResult SAL_CALL osl_getAddrOfSocketAddr(
326 oslSocketAddr Addr, sal_Sequence **ppByteSeq );
327
328 /*
329 Opaque datatype HostAddr.
330 */
331 typedef struct oslHostAddrImpl * oslHostAddr;
332
333
339 SAL_DLLPUBLIC oslHostAddr SAL_CALL osl_createHostAddr(
340 rtl_uString *strHostname, const oslSocketAddr Addr);
341
342
350 SAL_DLLPUBLIC oslHostAddr SAL_CALL osl_createHostAddrByName(rtl_uString *strHostname);
351
352
360 SAL_DLLPUBLIC oslHostAddr SAL_CALL osl_createHostAddrByAddr(const oslSocketAddr Addr);
361
362
366 SAL_DLLPUBLIC oslHostAddr SAL_CALL osl_copyHostAddr(const oslHostAddr Addr);
367
368
372 SAL_DLLPUBLIC void SAL_CALL osl_destroyHostAddr(oslHostAddr Addr);
373
374
378 SAL_DLLPUBLIC void SAL_CALL osl_getHostnameOfHostAddr(const oslHostAddr Addr, rtl_uString **strHostname);
379
380
384 SAL_DLLPUBLIC oslSocketAddr SAL_CALL osl_getSocketAddrOfHostAddr(const oslHostAddr Addr);
385
391 SAL_DLLPUBLIC oslSocketResult SAL_CALL osl_getLocalHostname(rtl_uString **strLocalHostname);
392
393
401 /*-***************************************************************************/
402 /* oslSocket */
403 /*-***************************************************************************/
404
405 typedef struct oslSocketImpl * oslSocket;
406
409 SAL_DLLPUBLIC void SAL_CALL osl_acquireSocket( oslSocket Socket );
410
416 SAL_DLLPUBLIC void SAL_CALL osl_releaseSocket( oslSocket Socket );
417
423 SAL_DLLPUBLIC oslSocket SAL_CALL osl_createSocket(
424 oslAddrFamily Family,
425 oslSocketType Type,
426 oslProtocol Protocol);
427
434 SAL_DLLPUBLIC oslSocketAddr SAL_CALL osl_getLocalAddrOfSocket(oslSocket Socket);
435
442 SAL_DLLPUBLIC oslSocketAddr SAL_CALL osl_getPeerAddrOfSocket(oslSocket Socket);
443
450 SAL_DLLPUBLIC sal_Bool SAL_CALL osl_bindAddrToSocket(
451 oslSocket Socket,
452 oslSocketAddr Addr);
453
465 SAL_DLLPUBLIC oslSocketResult SAL_CALL osl_connectSocketTo(
466 oslSocket Socket,
467 oslSocketAddr Addr,
468 const TimeValue* pTimeout);
469
470
479 SAL_DLLPUBLIC sal_Bool SAL_CALL osl_listenOnSocket(
480 oslSocket Socket,
481 sal_Int32 MaxPendingConnections);
482
483
491 SAL_DLLPUBLIC oslSocket SAL_CALL osl_acceptConnectionOnSocket
492 (oslSocket Socket,
493 oslSocketAddr* pAddr);
494
515 SAL_DLLPUBLIC sal_Int32 SAL_CALL osl_receiveSocket(
516 oslSocket Socket,
517 void* pBuffer,
518 sal_uInt32 BytesToRead,
519 oslSocketMsgFlag Flag);
520
543 SAL_DLLPUBLIC sal_Int32 SAL_CALL osl_receiveFromSocket(
544 oslSocket Socket,
545 oslSocketAddr SenderAddr,
546 void* pBuffer,
547 sal_uInt32 BufferSize,
548 oslSocketMsgFlag Flag);
549
568 SAL_DLLPUBLIC sal_Int32 SAL_CALL osl_sendSocket(
569 oslSocket Socket,
570 const void* pBuffer,
571 sal_uInt32 BytesToSend,
572 oslSocketMsgFlag Flag);
573
599 SAL_DLLPUBLIC sal_Int32 SAL_CALL osl_sendToSocket(
600 oslSocket Socket,
601 oslSocketAddr ReceiverAddr,
602 const void* pBuffer,
603 sal_uInt32 BytesToSend,
604 oslSocketMsgFlag Flag);
605
617 SAL_DLLPUBLIC sal_Bool SAL_CALL osl_isReceiveReady(
618 oslSocket Socket, const TimeValue* pTimeout);
619
630 SAL_DLLPUBLIC sal_Bool SAL_CALL osl_isSendReady(
631 oslSocket Socket, const TimeValue* pTimeout);
632
642 SAL_DLLPUBLIC sal_Bool SAL_CALL osl_isExceptionPending(
643 oslSocket Socket, const TimeValue* pTimeout);
644
656 SAL_DLLPUBLIC sal_Bool SAL_CALL osl_shutdownSocket(oslSocket Socket,
657 oslSocketDirection Direction);
658
743 SAL_DLLPUBLIC sal_Int32 SAL_CALL osl_getSocketOption( oslSocket Socket,
744 oslSocketOptionLevel Level,
745 oslSocketOption Option,
746 void* pBuffer,
747 sal_uInt32 BufferLen);
748
769 SAL_DLLPUBLIC sal_Bool SAL_CALL osl_setSocketOption( oslSocket Socket,
770 oslSocketOptionLevel Level,
771 oslSocketOption Option,
772 void* pBuffer,
773 sal_uInt32 BufferLen);
774
781 SAL_DLLPUBLIC sal_Bool SAL_CALL osl_enableNonBlockingMode(
782 oslSocket Socket, sal_Bool On);
783
784
789 SAL_DLLPUBLIC sal_Bool SAL_CALL osl_isNonBlockingMode(
790 oslSocket Socket);
791
792
805 SAL_DLLPUBLIC oslSocketType SAL_CALL osl_getSocketType(
806 oslSocket Socket);
807
812 SAL_DLLPUBLIC void SAL_CALL osl_getLastSocketErrorDescription(
813 oslSocket Socket, rtl_uString **strError);
814
820 SAL_DLLPUBLIC oslSocketError SAL_CALL osl_getLastSocketError(
821 oslSocket Socket);
822
825 typedef struct oslSocketSetImpl * oslSocketSet;
826
830 SAL_DLLPUBLIC oslSocketSet SAL_CALL osl_createSocketSet(void);
831
834 SAL_DLLPUBLIC void SAL_CALL osl_destroySocketSet(oslSocketSet Set);
835
839 SAL_DLLPUBLIC void SAL_CALL osl_clearSocketSet(oslSocketSet Set);
840
841
846 SAL_DLLPUBLIC void SAL_CALL osl_addToSocketSet(oslSocketSet Set, oslSocket Socket);
847
852 SAL_DLLPUBLIC void SAL_CALL osl_removeFromSocketSet(oslSocketSet Set, oslSocket Socket);
853
859 SAL_DLLPUBLIC sal_Bool SAL_CALL osl_isInSocketSet(oslSocketSet Set, oslSocket Socket);
860
876 SAL_DLLPUBLIC sal_Int32 SAL_CALL osl_demultiplexSocketEvents(oslSocketSet IncomingSet,
877 oslSocketSet OutgoingSet,
878 oslSocketSet OutOfBandSet,
879 const TimeValue* pTimeout);
880
884 SAL_DLLPUBLIC void SAL_CALL osl_closeSocket(oslSocket Socket);
885
886
896 SAL_DLLPUBLIC sal_Int32 SAL_CALL osl_readSocket( oslSocket Socket, void *pBuffer, sal_Int32 nSize );
897
898
907 SAL_DLLPUBLIC sal_Int32 SAL_CALL osl_writeSocket( oslSocket Socket, const void *pBuffer, sal_Int32 nSize );
908
914 #ifdef __cplusplus
915 }
916 #endif
917
918 #endif /* _OSL_SOCKET_H_ */
919
920 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
osl_Socket_OptionRcvBuf
Definition: socket.h:95
osl_getSocketType
SAL_DLLPUBLIC oslSocketType osl_getSocketType(oslSocket Socket)
Queries the socket for its type.
oslSocketDirection
oslSocketDirection
Used by shutdown to denote which end of the socket to "close".
Definition: socket.h:134
osl_Socket_Ok
Definition: socket.h:184
osl_Socket_E_DestAddrReq
Definition: socket.h:147
osl_Socket_E_PfNoSupport
Definition: socket.h:154
osl_Socket_E_FORCE_EQUAL_SIZE
Definition: socket.h:178
osl_Socket_DirWrite
Definition: socket.h:136
osl_receiveFromSocket
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.
osl_Socket_E_AddrInUse
Definition: socket.h:157
osl_Socket_E_ProtocolNoSupport
Definition: socket.h:151
osl_destroySocketSet
SAL_DLLPUBLIC void osl_destroySocketSet(oslSocketSet Set)
Destroys a oslSocketSet.
osl_Socket_Error
Definition: socket.h:185
osl_Socket_Dir_FORCE_EQUAL_SIZE
Definition: socket.h:139
sal_uInt8
unsigned char sal_uInt8
Definition: types.h:43
osl_Socket_E_OpNotSupport
Definition: socket.h:153
osl_Socket_E_TooManyRefs
Definition: socket.h:169
osl_Socket_E_NotSocket
Definition: socket.h:146
oslSocketMsgFlag
oslSocketMsgFlag
Represents flags to be used with send/recv-calls.
Definition: socket.h:121
osl_getAddrOfSocketAddr
SAL_DLLPUBLIC oslSocketResult osl_getAddrOfSocketAddr(oslSocketAddr Addr, sal_Sequence **ppByteSeq)
Returns the addr field in the struct sockaddr.
osl_getHostnameOfHostAddr
SAL_DLLPUBLIC void osl_getHostnameOfHostAddr(const oslHostAddr Addr, rtl_uString **strHostname)
Get the hostname member of Addr.
osl_Socket_DirInvalid
Definition: socket.h:138
osl_getServicePort
SAL_DLLPUBLIC sal_Int32 osl_getServicePort(rtl_uString *strServicename, rtl_uString *strProtocol)
Looks up the port-number designated to the specified service/protocol-pair.
osl_Socket_TypeStream
Definition: socket.h:71
osl_Socket_OptionType
Definition: socket.h:101
osl_Socket_FORCE_EQUAL_SIZE
Definition: socket.h:189
osl_Socket_LevelTcp
Definition: socket.h:112
osl_Socket_E_ConnReset
Definition: socket.h:164
osl_Socket_ProtocolIpx
Definition: socket.h:59
TimeValue
Definition: time.h:42
osl_Socket_MsgMaxIOVLen
Definition: socket.h:126
osl_Socket_LevelSocket
Definition: socket.h:111
oslSocketSet
struct oslSocketSetImpl * oslSocketSet
Type for the representation of socket sets.
Definition: socket.h:823
osl_Socket_TypeInvalid
Definition: socket.h:76
osl_Socket_Family_FORCE_EQUAL_SIZE
Definition: socket.h:51
osl_removeFromSocketSet
SAL_DLLPUBLIC void osl_removeFromSocketSet(oslSocketSet Set, oslSocket Socket)
Removes a socket from the set.
osl_Socket_E_AfNoSupport
Definition: socket.h:155
osl_getInetPortOfSocketAddr
SAL_DLLPUBLIC sal_Int32 osl_getInetPortOfSocketAddr(oslSocketAddr Addr)
Retrieves the internet port-number of Addr.
byteseq.h
oslSocketAddr
struct oslSocketAddrImpl * oslSocketAddr
Opaque datatype SocketAddr.
Definition: socket.h:41
osl_Socket_E_Shutdown
Definition: socket.h:168
osl_Socket_ProtocolIp
Definition: socket.h:58
osl_releaseSocket
SAL_DLLPUBLIC void osl_releaseSocket(oslSocket Socket)
decreases the refcount of the socket handle by one.
SAL_DLLPUBLIC
#define SAL_DLLPUBLIC
Definition: saldllapi.h:30
oslSocketIpxNodeNumber
sal_uInt8 oslSocketIpxNodeNumber[6]
Definition: socket.h:193
osl_isInSocketSet
SAL_DLLPUBLIC sal_Bool osl_isInSocketSet(oslSocketSet Set, oslSocket Socket)
Checks if socket is in the set.
oslSocketOption
oslSocketOption
Represents socket-options.
Definition: socket.h:84
osl_getDottedInetAddrOfSocketAddr
SAL_DLLPUBLIC oslSocketResult osl_getDottedInetAddrOfSocketAddr(oslSocketAddr Addr, rtl_uString **strDottedInetAddr)
Gets the address in dotted decimal format.
osl_Socket_E_None
Definition: socket.h:145
osl_createHostAddrByName
SAL_DLLPUBLIC oslHostAddr osl_createHostAddrByName(rtl_uString *strHostname)
Create an oslHostAddr by resolving the given strHostname.
oslHostAddr
struct oslHostAddrImpl * oslHostAddr
Definition: socket.h:330
osl_Socket_OptionOOBinLine
Definition: socket.h:93
osl_isNonBlockingMode
SAL_DLLPUBLIC sal_Bool osl_isNonBlockingMode(oslSocket Socket)
Query state of non-blocking-mode of the socket.
oslSocketIpxNetNumber
sal_uInt8 oslSocketIpxNetNumber[4]
Definition: socket.h:192
osl_Socket_Type_FORCE_EQUAL_SIZE
Definition: socket.h:77
osl_getSocketAddrOfHostAddr
SAL_DLLPUBLIC oslSocketAddr osl_getSocketAddrOfHostAddr(const oslHostAddr Addr)
Get the socket address member of Addr.
osl_Socket_E_InvalidError
Definition: socket.h:177
osl_createHostAddr
SAL_DLLPUBLIC oslHostAddr osl_createHostAddr(rtl_uString *strHostname, const oslSocketAddr Addr)
Create an oslHostAddr from given hostname and socket address.
oslSocketType
oslSocketType
Represents the type of a socket.
Definition: socket.h:70
osl_createEmptySocketAddr
SAL_DLLPUBLIC oslSocketAddr osl_createEmptySocketAddr(oslAddrFamily Family)
Creates a socket-address for the given family.
osl_Socket_E_NetUnreachable
Definition: socket.h:160
osl_Socket_E_HostDown
Definition: socket.h:172
osl_Socket_Interrupted
Definition: socket.h:187
osl_Socket_E_MsgSize
Definition: socket.h:148
tencinfo.h
osl_getLastSocketError
SAL_DLLPUBLIC oslSocketError osl_getLastSocketError(oslSocket Socket)
returns a constant decribing the last error for the socket system.
osl_createSocketSet
SAL_DLLPUBLIC oslSocketSet osl_createSocketSet(void)
Creates a set of sockets to be used with osl_demultiplexSocketEvents().
osl_Socket_OptionDontRoute
Definition: socket.h:89
osl_getPeerAddrOfSocket
SAL_DLLPUBLIC oslSocketAddr osl_getPeerAddrOfSocket(oslSocket Socket)
Retrieves the Address of the remote end of the socket.
osl_Socket_OptionUseLoopback
Definition: socket.h:91
osl_Socket_ProtocolSpxII
Definition: socket.h:61
osl_Socket_E_NetReset
Definition: socket.h:161
osl_Socket_OptionReuseAddr
Definition: socket.h:87
osl_closeSocket
SAL_DLLPUBLIC void osl_closeSocket(oslSocket Socket)
Closes the socket terminating any ongoing dataflow.
osl_Socket_E_InProgress
Definition: socket.h:176
osl_Socket_E_NetDown
Definition: socket.h:159
osl_resolveHostname
SAL_DLLPUBLIC oslSocketAddr osl_resolveHostname(rtl_uString *strHostname)
Uses the systems name-service interface to find an address for strHostname.
osl_writeSocket
SAL_DLLPUBLIC sal_Int32 osl_writeSocket(oslSocket Socket, const void *pBuffer, sal_Int32 nSize)
Writes n bytes from pBuffer to the stream.
oslSocket
struct oslSocketImpl * oslSocket
Definition: socket.h:403
osl_Socket_TypeSeqPacket
Definition: socket.h:75
osl_Socket_ProtocolSpx
Definition: socket.h:60
osl_Socket_E_Already
Definition: socket.h:175
osl_Socket_E_TimedOut
Definition: socket.h:170
osl_Socket_LevelInvalid
Definition: socket.h:113
osl_sendSocket
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.
osl_bindAddrToSocket
SAL_DLLPUBLIC sal_Bool osl_bindAddrToSocket(oslSocket Socket, oslSocketAddr Addr)
Binds the given address to the socket.
osl_Socket_E_ConnRefused
Definition: socket.h:171
osl_Socket_TimedOut
Definition: socket.h:186
_sal_Sequence
This is the binary specification of a SAL sequence.
Definition: types.h:323
osl_isSendReady
SAL_DLLPUBLIC sal_Bool osl_isSendReady(oslSocket Socket, const TimeValue *pTimeout)
Checks if send operations will block.
osl_createInetBroadcastAddr
SAL_DLLPUBLIC oslSocketAddr osl_createInetBroadcastAddr(rtl_uString *strDottedAddr, sal_Int32 Port)
Create an internet address usable for sending broadcast datagrams.
osl_sendToSocket
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...
osl_Socket_E_NoProtocol
Definition: socket.h:150
osl_isEqualSocketAddr
SAL_DLLPUBLIC sal_Bool osl_isEqualSocketAddr(oslSocketAddr Addr1, oslSocketAddr Addr2)
Compares the values of two SocketAddresses.
oslSocketError
oslSocketError
Describes the various error socket error conditions, which may occur.
Definition: socket.h:144
osl_readSocket
SAL_DLLPUBLIC sal_Int32 osl_readSocket(oslSocket Socket, void *pBuffer, sal_Int32 nSize)
Retrieves n bytes from the stream and copies them into pBuffer.
osl_Socket_Option_FORCE_EQUAL_SIZE
Definition: socket.h:104
osl_Socket_TypeRaw
Definition: socket.h:73
oslProtocol
oslProtocol
represent a specific protocol within a address-family
Definition: socket.h:57
osl_Socket_E_HostUnreachable
Definition: socket.h:173
osl_Socket_OptionSndLowat
Definition: socket.h:96
osl_createInetSocketAddr
SAL_DLLPUBLIC oslSocketAddr osl_createInetSocketAddr(rtl_uString *strDottedAddr, sal_Int32 Port)
Create an internet-address, consisting of hostaddress and port.
osl_Socket_OptionBroadcast
Definition: socket.h:90
osl_getLastSocketErrorDescription
SAL_DLLPUBLIC void osl_getLastSocketErrorDescription(oslSocket Socket, rtl_uString **strError)
returns a string which describes the last socket error.
osl_Socket_MsgPeek
Definition: socket.h:124
osl_destroySocketAddr
SAL_DLLPUBLIC void osl_destroySocketAddr(oslSocketAddr Addr)
Frees all resources allocated by Addr.
osl_Socket_FamilyIpx
Definition: socket.h:49
osl_Socket_E_TypeNoSupport
Definition: socket.h:152
osl_copySocketAddr
SAL_DLLPUBLIC oslSocketAddr osl_copySocketAddr(oslSocketAddr Addr)
Creates a new SocketAddress and fills it from Addr.
osl_Socket_OptionAcceptConn
Definition: socket.h:86
osl_acceptConnectionOnSocket
SAL_DLLPUBLIC oslSocket osl_acceptConnectionOnSocket(oslSocket Socket, oslSocketAddr *pAddr)
Waits for an ingoing connection on the socket.
osl_Socket_E_ConnAborted
Definition: socket.h:163
osl_demultiplexSocketEvents
SAL_DLLPUBLIC sal_Int32 osl_demultiplexSocketEvents(oslSocketSet IncomingSet, oslSocketSet OutgoingSet, oslSocketSet OutOfBandSet, const TimeValue *pTimeout)
Checks multiple sockets for events.
osl_Socket_E_WouldBlock
Definition: socket.h:174
osl_getSocketOption
SAL_DLLPUBLIC sal_Int32 osl_getSocketOption(oslSocket Socket, oslSocketOptionLevel Level, oslSocketOption Option, void *pBuffer, sal_uInt32 BufferLen)
Retrieves attributes associated with the socket.
osl_receiveSocket
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.
osl_Socket_Msg_FORCE_EQUAL_SIZE
Definition: socket.h:128
oslSocketResult
oslSocketResult
Common return codes of socket related functions.
Definition: socket.h:183
osl_Socket_MsgNormal
Definition: socket.h:122
osl_Socket_OptionError
Definition: socket.h:100
osl_Socket_OptionRcvTimeo
Definition: socket.h:99
osl_acquireSocket
SAL_DLLPUBLIC void osl_acquireSocket(oslSocket Socket)
increases the refcount of the socket handle by one
osl_Socket_FamilyInet
Definition: socket.h:48
osl_isExceptionPending
SAL_DLLPUBLIC sal_Bool osl_isExceptionPending(oslSocket Socket, const TimeValue *pTimeout)
Checks if a request for out-of-band data will block.
osl_shutdownSocket
SAL_DLLPUBLIC sal_Bool osl_shutdownSocket(oslSocket Socket, oslSocketDirection Direction)
Shuts down communication on a connected socket.
osl_Socket_OptionRcvLowat
Definition: socket.h:97
osl_createSocket
SAL_DLLPUBLIC oslSocket osl_createSocket(oslAddrFamily Family, oslSocketType Type, oslProtocol Protocol)
Create a socket of the specified Family and Type.
osl_isReceiveReady
SAL_DLLPUBLIC sal_Bool osl_isReceiveReady(oslSocket Socket, const TimeValue *pTimeout)
Checks if read operations will block.
osl_Socket_E_AddrNotAvail
Definition: socket.h:158
osl_createHostAddrByAddr
SAL_DLLPUBLIC oslHostAddr osl_createHostAddrByAddr(const oslSocketAddr Addr)
Create an oslHostAddr by reverse resolution of the given Addr.
time.h
osl_Socket_OptionSndBuf
Definition: socket.h:94
osl_connectSocketTo
SAL_DLLPUBLIC oslSocketResult osl_connectSocketTo(oslSocket Socket, oslSocketAddr Addr, const TimeValue *pTimeout)
Connects the socket to the given address.
oslAddrFamily
oslAddrFamily
Represents the address-family of a socket.
Definition: socket.h:47
oslSocketOptionLevel
oslSocketOptionLevel
Represents the different socket-option levels.
Definition: socket.h:110
osl_listenOnSocket
SAL_DLLPUBLIC sal_Bool osl_listenOnSocket(oslSocket Socket, sal_Int32 MaxPendingConnections)
Prepares the socket to act as an acceptor of incoming connections.
osl_Socket_Level_FORCE_EQUAL_SIZE
Definition: socket.h:114
osl_copyHostAddr
SAL_DLLPUBLIC oslHostAddr osl_copyHostAddr(const oslHostAddr Addr)
Create a copy of the given Addr.
osl_setAddrOfSocketAddr
SAL_DLLPUBLIC oslSocketResult osl_setAddrOfSocketAddr(oslSocketAddr Addr, sal_Sequence *pByteSeq)
Sets the addr field in the struct sockaddr with pByteSeq.
osl_getLocalHostname
SAL_DLLPUBLIC oslSocketResult osl_getLocalHostname(rtl_uString **strLocalHostname)
Retrieve this machines hostname.
osl_Socket_TypeDgram
Definition: socket.h:72
osl_enableNonBlockingMode
SAL_DLLPUBLIC sal_Bool osl_enableNonBlockingMode(oslSocket Socket, sal_Bool On)
Enables/disables non-blocking-mode of the socket.
osl_getFamilyOfSocketAddr
SAL_DLLPUBLIC oslAddrFamily osl_getFamilyOfSocketAddr(oslSocketAddr Addr)
Retrieves the address-family from the Addr.
osl_Socket_MsgOOB
Definition: socket.h:123
osl_Socket_OptionLinger
Definition: socket.h:92
osl_Socket_E_NoBufferSpace
Definition: socket.h:165
sal_Bool
unsigned char sal_Bool
Definition: types.h:37
osl_clearSocketSet
SAL_DLLPUBLIC void osl_clearSocketSet(oslSocketSet Set)
Clears the set from all previously added sockets.
osl_setSocketOption
SAL_DLLPUBLIC sal_Bool osl_setSocketOption(oslSocket Socket, oslSocketOptionLevel Level, oslSocketOption Option, void *pBuffer, sal_uInt32 BufferLen)
Sets the sockets attributes.
osl_Socket_DirRead
Definition: socket.h:135
osl_Socket_Protocol_FORCE_EQUAL_SIZE
Definition: socket.h:63
osl_setInetPortOfSocketAddr
SAL_DLLPUBLIC sal_Bool osl_setInetPortOfSocketAddr(oslSocketAddr Addr, sal_Int32 Port)
Sets the Port of Addr.
osl_getLocalAddrOfSocket
SAL_DLLPUBLIC oslSocketAddr osl_getLocalAddrOfSocket(oslSocket Socket)
Retrieves the Address of the local end of the socket.
osl_Socket_E_IsConnected
Definition: socket.h:166
osl_destroyHostAddr
SAL_DLLPUBLIC void osl_destroyHostAddr(oslHostAddr Addr)
Frees all resources allocated by Addr.
osl_Socket_E_Prototype
Definition: socket.h:149
osl_Socket_OptionTcpNoDelay
Definition: socket.h:102
osl_Socket_E_NotConnected
Definition: socket.h:167
osl_Socket_InProgress
Definition: socket.h:188
osl_addToSocketSet
SAL_DLLPUBLIC void osl_addToSocketSet(oslSocketSet Set, oslSocket Socket)
Adds a socket to the set.
osl_Socket_FamilyInvalid
Definition: socket.h:50
osl_Socket_MsgDontRoute
Definition: socket.h:125
osl_Socket_OptionDebug
Definition: socket.h:85
osl_Socket_OptionSndTimeo
Definition: socket.h:98
osl_Socket_OptionInvalid
Definition: socket.h:103
osl_getHostnameOfSocketAddr
SAL_DLLPUBLIC oslSocketResult osl_getHostnameOfSocketAddr(oslSocketAddr Addr, rtl_uString **strHostname)
Returns the hostname represented by Addr.
osl_Socket_MsgInvalid
Definition: socket.h:127
osl_Socket_OptionKeepAlive
Definition: socket.h:88
osl_Socket_TypeRdm
Definition: socket.h:74
osl_Socket_ProtocolInvalid
Definition: socket.h:62
osl_Socket_DirReadWrite
Definition: socket.h:137
ustring.h