SNode.C
Loading...
Searching...
No Matches
web::websocket::client Namespace Reference

Classes

class  SocketContextUpgrade
class  SubProtocolFactorySelector
class  SocketContextUpgradeFactory
class  SubProtocol

Functions

int getentropy (void *buf, size_t buflen)
web::http::client::SocketContextUpgradeFactorywebsocketClientSocketContextUpgradeFactory ()

Function Documentation

◆ getentropy()

int web::websocket::client::getentropy ( void * buf,
size_t buflen )

Definition at line 72 of file SocketContextUpgradeFactory.cpp.

72 {
73#ifdef SYS_GETRANDOM
74 const ssize_t ret = syscall(SYS_getrandom, buf, buflen, 0);
75#else
76 // Fallback to /dev/urandom if necessary
77 const int fd = open("/dev/urandom", O_RDONLY);
78 if (fd == -1) {
79 return -1;
80 }
81 const ssize_t ret = read(fd, buf, buflen);
82 close(fd);
83#endif
84 return (ret == static_cast<ssize_t>(buflen)) ? 0 : -1;
85 }

Referenced by web::websocket::client::SocketContextUpgradeFactory::prepare().

Here is the caller graph for this function:

◆ websocketClientSocketContextUpgradeFactory()

web::http::client::SocketContextUpgradeFactory * web::websocket::client::websocketClientSocketContextUpgradeFactory ( )

Definition at line 134 of file SocketContextUpgradeFactory.cpp.

References web::websocket::client::SocketContextUpgradeFactory::SocketContextUpgradeFactory().

Referenced by web::websocket::client::SocketContextUpgradeFactory::link().

Here is the call graph for this function:
Here is the caller graph for this function: