Go to the documentation of this file.
2 #define _OME_SOCKET_H "$Id: OMEsocket.h 357 2020-06-18 23:13:25Z geoff $"
15 uint32_t openMode,
int *errRet =
nullptr);
27 uint32_t activeEvents;
40 return (
reinterpret_cast<const uint64_t
>(eventHandle));
44 virtual int readBytes(
unsigned char *bfr,
size_t bytes,
size_t *actualBytes,
int *errRet)
override;
46 virtual int writeBytes(
const unsigned char *bfr,
size_t bytes,
size_t *actualBytes,
int *errRet)
override;
50 size_t *actualBytes,
int *errRet,
size_t skipBytes = 0)
override;
56 virtual int close(
int mask)
override;
69 size_t *actualBytes,
OMEstring *fromInfo,
int *errRet)
override;
71 virtual int sendDatagram(
const unsigned char *bfr,
size_t bytes,
72 size_t *actualBytes,
const char *toInfo,
int *errRet)
override;
80 const char *fileName);
bool(* OMEeventCallbackFP)(class OMEevent *, OMEthread *)
Definition: OMEevent.h:16
@ listen
Definition: OMEioObjects.h:28
ssize_t substr(const OMEstring &sub, size_t startOffset=0) const
Definition: OMEstring.h:490
SOCKET sock
Definition: sockspx.c:203
@ socket
Definition: OMEioEvents.h:20
void initializeAsType(const enum OMEtypes_t t)
The fundamental tagged data type used through the FARGOS/VISTA infrastructure.
Definition: OMEtype.cpp:95
virtual int getErrorStatus() const override
Definition: OMEsocket.cpp:942
const char s[]
Definition: t.cpp:4
virtual OMEioDescriptor * acceptConnection(int *errRet) override
Definition: OMEsocket.cpp:767
OMEstring * OMEdisplayableAddress(const struct sockaddr *sock, const int len, const uint32_t openMode)
Convert sockaddr data into a text string.
Definition: OMEaddr.cpp:349
@ nonblocking
Definition: OMEioObjects.h:31
bool selectedForRead
Definition: OMEsocket.h:21
@ selectRead
Definition: OMEioEvents.h:21
@ selectWrite
Definition: OMEioEvents.h:21
@ raw
Definition: OMEioObjects.h:32
Implements text and binary string storage.
Definition: OMEstring.h:305
#define EAGAIN
Definition: tmp.o.cpp:64
virtual int readBytes(unsigned char *bfr, size_t bytes, size_t *actualBytes, int *errRet) override
Definition: OMEsocket.cpp:428
#define OUR_sockaddr_in6
Definition: OMEsocket.cpp:115
OMEunixDomainDescriptor(uint64_t handle, OMEioDescriptor::OMEopenMode t, const char *fileName)
Definition: OMEsocket.cpp:968
Fundamental ANY type for FARGOS/VISTA Object Management Environment.
Definition: OMEbaseType.h:250
static OMEioDescriptor * openSocket(struct sockaddr *sock, int sockLen, uint32_t openMode, int *errRet=nullptr)
Definition: OMEsocket.cpp:155
I/O-specific event.
Definition: OMEioEvents.h:16
virtual OMEstring * getLocalAddress() const override
Definition: OMEsocket.cpp:929
#define MAX_IO_VECTORS
Definition: OMEsocket.cpp:62
#define LOG_COUT(lvl)
Convenience macro that uses LOG_INTO() to conditionally log a message to standard output.
Definition: logging_api.hpp:3007
class OMEstring * s
Definition: OMEbaseType.h:299
Networking-specific I/O descriptor.
Definition: OMEsocket.h:12
virtual OMEevent * selectForRead(OMEeventCallbackFP func, OMEthread *t=nullptr) override
Definition: OMEsocket.cpp:705
@ multicast
Definition: OMEioObjects.h:32
#define ntohs(x)
Definition: tmp.o.cpp:3103
@ datagram
Definition: OMEioObjects.h:32
static OMEioDescriptor * openSocketScheme(const OMEstring &url, int *errRet=nullptr)
Definition: OMEsocket.cpp:366
virtual int close(int mask) override
Definition: OMEsocket.cpp:752
const char srcID[]
Definition: catSym.c:17
@ OME_STRING
Definition: OMEmanifests.h:85
void * extraData
Any event-specific data.
Definition: OMEevent.h:33
#define CLOSE_SOCKET(f)
Definition: OMEsocket.cpp:26
virtual int sendDatagram(const unsigned char *bfr, size_t bytes, size_t *actualBytes, const char *toInfo, int *errRet) override
Definition: OMEsocket.cpp:871
virtual OMEevent * selectForWrite(OMEeventCallbackFP func, OMEthread *t=nullptr) override
Definition: OMEsocket.cpp:734
OMEstring socketFileName
Definition: OMEsocket.h:77
OMEsocketDescriptor(uint64_t handle, OMEioDescriptor::OMEopenMode t)
Definition: OMEsocket.cpp:390
@ OME_NIL
Definition: OMEmanifests.h:78
uint64_t getSelectHandle() const OME_ALWAYS_INLINE
Definition: OMEioObjects.h:50
virtual OMEstring * getPeerAddress() const override
Definition: OMEsocket.cpp:951
uint32_t savedOpenMode
Definition: OMEsocket.h:19
OME fundamental type implementation.
uint_fast16_t adjustVector(OMEioVector *result, uint_fast16_t count, const OMEioVector *v, size_t skipCount)
Definition: OMEioObjects.cpp:121
Equivalent of iov structure.
Definition: OMEioObjects.h:18
virtual int writeBytes(const unsigned char *bfr, size_t bytes, size_t *actualBytes, int *errRet) override
Definition: OMEsocket.cpp:460
uint32_t ui
Definition: OMEbaseType.h:286
OMEopenMode
Definition: OMEioObjects.h:28
size_t length() const
Definition: OMEstring.h:401
~OMEunixDomainDescriptor()
Definition: OMEsocket.cpp:979
const char srcID[] OME_USED
Definition: tick_time.cpp:24
void OMEregisterStandardSocketSchemes()
Register standard socket-related I/O transport schemes.
Definition: OMEsocket.cpp:1083
int openSides
Definition: OMEsocket.h:20
Record to define the implementation of an OIL2 function.
Definition: OMEthread.h:287
uint64_t ioHandle
Definition: OMEioObjects.h:36
int OMEtransportToSockaddr(sockBigEnough *sock, uint_fast16_t *sockLen, int *sockMode, const char *url, uint_fast16_t urlLen)
Convert textual transport address into sockaddr structure.
Definition: OMEaddr.cpp:702
int errno
Definition: ethers.c:41
virtual int writeVectorOfBytes(const OMEioVector *v, uint_fast16_t elementCount, size_t *actualBytes, int *errRet, size_t skipBytes=0) override
Definition: OMEsocket.cpp:505
@ connect
Definition: OMEioObjects.h:29
bool selectedForWrite
Definition: OMEsocket.h:22
Base class for events within the FARGOS/VISTA Object Management Environment.
Definition: OMEevent.h:22
int elementCount(OMEthread *thread, OMEtype &result, const OMEtype &arg)
Definition: OILtypeFuncs.cpp:168
int dottedAddress(OMEthread *thread, OMEtype &result, const OMEtype &arg)
Definition: OMEsocket.cpp:1063
uint32_t OMEmethodSignature(const int argc, const uint32_t types[], uint32_t *maskPtr)
Compute 32-bit signature of a method's arguments.
Definition: OMEsignature.cpp:15
OME debug and profiling interfaces.
#define OME_DLL_EXPORT
Definition: compiler_hints.h:464
Public interface to an OME thread.
Definition: OMEthread.h:60
#define LOG_ENDLINE
Closing clause for text line output using << operators.
Definition: logging_api.hpp:2956
@ OME_ANY
Definition: OMEmanifests.h:93
virtual bool isOpen() const override
Definition: OMEsocket.h:64
~OMEsocketDescriptor()
Definition: OMEsocket.cpp:410
uint32_t type
Definition: OMEbaseType.h:304
int OMEregisterIOscheme(const OMEstring &prefix, OMEopenSchemeFP func)
Register support for new I/O transport scheme.
Definition: OMEioObjects.cpp:219
#define EINPROGRESS
Definition: tmp.o.cpp:92
@ OME_ARRAY
Definition: OMEmanifests.h:86
int lookupAddress(OMEthread *thread, OMEtype &result, const OMEtype &hostOrAddress)
Definition: OMEsocket.cpp:997
Base class for open files and sockets.
Definition: OMEioObjects.h:26
OME_DLL_EXPORT void INIT_DECLARE_socket()
Definition: OMEsocket.cpp:1105
int fd
Definition: ethers.c:41
virtual int receiveDatagram(unsigned char *bfr, size_t bytes, size_t *actualBytes, OMEstring *fromInfo, int *errRet) override
Definition: OMEsocket.cpp:825
#define ERROR_CODE
Definition: OMEsocket.cpp:25
@ OME_INT32
Definition: OMEmanifests.h:79
Unix file-domain socket-specific I/O descriptor.
Definition: OMEsocket.h:75
#define LOG_CERR(lvl)
Convenience macro that uses LOG_INTO() to conditionally log a message to standard error.
Definition: logging_api.hpp:3014