Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/dermesser/libsocket
/ functions
Functions
122 in github.com/dermesser/libsocket
⨍
Functions
122
◇
Types & classes
37
↓ 23 callers
Function
check_error
* @brief Checks return value for error. * * Every value returned by a syscall is passed to this function. It returns 0 * if the return value is ok
C/inet/libinetsocket.c:129
↓ 17 callers
Function
check_error
* @brief Checks return value for error. * * Every value returned by a syscall is passed to this function. It returns 0 * if the return value is ok
C/unix/libunixsocket.c:89
↓ 7 callers
Method
destroy
* @brief Destroys a socket. * * @retval 0 Fine! * @retval <0 Most likely the socket was already closed before. */
C++/socket.cpp:72
↓ 6 callers
Function
create_inet_server_socket
* @brief Create a TCP or UDP server socket * * To accept connections from clients via TCP or receive datagrams via UDP, you * need to create a serv
C/inet/libinetsocket.c:672
↓ 6 callers
Function
destroy_inet_socket
* @brief Close a socket. * * This function closes a socket. You may also use `close(2)`. * * @param sfd The file descriptor * * @retval 0 Closed
C/inet/libinetsocket.c:597
↓ 6 callers
Function
destroy_unix_socket
* @brief Close a socket * * Actually, it's the same as `close(2)`. * * @param sfd The socket to close. * * @retval 0 Socket could be closed * @
C/unix/libunixsocket.c:250
↓ 5 callers
Method
rcv
* @brief Receive data from a connected DGRAM socket * * If a datagram socket is connected, this function may be called to receive * data sent from
C++/dgramclient.cpp:73
↓ 5 callers
Function
recvfrom_unix_dgram_socket
* @brief Receive datagram from another UNIX socket * * @param sfd The socket descriptor * @param buf The buffer to which the data is written * @pa
C/unix/libunixsocket.c:392
↓ 5 callers
Method
sndto
* @brief Send data to datagram socket * * @param buf Pointer to data. * @param length Length of `buf` * @param path Path of destination * @param
C++/unixdgram.cpp:59
↓ 4 callers
Function
connect_inet_dgram_socket
* @brief Connect a UDP socket. * * If a datagram socket is connected, all data written to it (using `write(2)`) * is sent to the peer connected to
C/inet/libinetsocket.c:502
↓ 4 callers
Function
create_inet_dgram_socket
* @brief Creates a new UDP/IP socket * * Returns an integer describing a DGRAM (UDP) socket. The socket is * automatically bound to some port. *
C/inet/libinetsocket.c:252
↓ 4 callers
Function
create_unix_server_socket
* @brief Create a passive UNIX socket * * Creating a DGRAM server socket is the same as creating one * using `create_unix_dgram_socket()` but with
C/unix/libunixsocket.c:306
↓ 4 callers
Method
rcvfrom
* @brief Receive data and store the sender's address * * @param buf Receive buffer * @param length Length of `buf` * @param source Buffer for send
C++/unixdgram.cpp:124
↓ 4 callers
Method
rcvmsg
* @brief Receive a message and place it into dst. * * No more than dst.size() bytes will be received and placed into dst. */
C++/dgramoverstream.cpp:81
↓ 4 callers
Function
recvfrom_inet_dgram_socket
* @brief Receive data from a UDP/IP socket * * Receives data like `recvfrom(2)`. Pointers may be `NULL`, then the * information (e.g. the source po
C/inet/libinetsocket.c:387
↓ 4 callers
Function
sendto_inet_dgram_socket
* @brief This function is the equivalent to `sendto(2)` * * @param sfd is the *Socket File Descriptor* (every socket file descriptor * argument in
C/inet/libinetsocket.c:305
↓ 4 callers
Method
snd
* @brief Send data to connected socket * * @param buf Pointer to the data * @param len The length of the buffer * @param flags Flags for `send(2)`
C++/dgramclient.cpp:135
↓ 4 callers
Method
sndmsg
C++/dgramoverstream.cpp:72
↓ 3 callers
Function
connect_unix_dgram_socket
* @brief Connect a datagram socket * * Connects a datagram socket to the specified socket so the * stream i/o operations may be used (`read(2)/writ
C/unix/libunixsocket.c:202
↓ 3 callers
Function
create_inet_stream_socket
* @brief Create and connect a new TCP/IP socket * * This function returns a working client TCP/IP socket. * * @param host The host the socket will
C/inet/libinetsocket.c:157
↓ 3 callers
Function
create_unix_dgram_socket
* @brief Create a UNIX DGRAM socket * * @param bind_path If not `NULL`, bind to `bind_path`. * @param flags Flags to pass to `socket(2)` (varies fr
C/unix/libunixsocket.c:155
↓ 3 callers
Method
getfd
* @brief Returns the socket file descriptor. * * @return The socket file descriptor of the class. * * getfd() is a getter you may use to obtain th
C++/socket.cpp:91
↓ 3 callers
Function
sendto_unix_dgram_socket
* @brief Send datagram to socket * * @param sfd Socket * @param buf Data to be sent * @param size The length of the buffer `buf` * @param path De
C/unix/libunixsocket.c:423
↓ 3 callers
Method
shutdown
* @brief Shut a socket down * * Shuts a socket down using `shutdown(2)`. * * @param method `LIBSOCKET_READ/LIBSOCKET_WRITE` or an `OR`ed combinati
C++/streamclient.cpp:279
↓ 2 callers
Method
accept2
* @brief Accept a connection and return a socket connected to the client. * * The caller owns the client socket. * * @param numeric Specifies if t
C++/inetserverstream.cpp:230
↓ 2 callers
Function
accept_inet_stream_socket
* @brief Accept a connection attempt on a server socket. * * This function accepts an incoming connection on a server socket. * * (the `src_*` arg
C/inet/libinetsocket.c:793
↓ 2 callers
Function
accept_unix_stream_socket
* @brief Accept connections on a passive UNIX socket * * @param sfd The server socket * @param flags Flags for `accept4(3)` (therefore useless on a
C/unix/libunixsocket.c:367
↓ 2 callers
Method
add_fd
headers/epoll.hpp:137
↓ 2 callers
Function
create_unix_stream_socket
* @brief Create and connect a new UNIX STREAM socket. * * Creates and connects a new STREAM socket with the socket given in `path`. * * @retval >0
C/unix/libunixsocket.c:112
↓ 2 callers
Function
decode_uint32
C++/framing.cpp:47
↓ 2 callers
Function
encode_uint32
C++/framing.cpp:41
↓ 2 callers
Function
get_address_family
* @brief Look up which address families a host supports. * * If you want to send a datagram to a host but you don't know * if it supports IPv4 or I
C/inet/libinetsocket.c:904
↓ 2 callers
Method
wait
headers/epoll.hpp:187
↓ 1 callers
Method
accept
* @brief Accept a connection and return a socket connected to the client. * * Waits for a client to connect and returns a pointer to a inet_stream o
C++/inetserverstream.cpp:177
↓ 1 callers
Method
connect
* @brief Connect datagram socket. * * Connect a datagram socket to a remote peer so only its packets are received * and all data written is sent to
C++/inetclientdgram.cpp:166
↓ 1 callers
Function
create_multicast_socket
C/inet/libinetsocket.c:966
↓ 1 callers
Method
deconnect
* @brief Break association to host. Does not close the socket. * * *Should actually be called 'disconnect'* * */
C++/inetclientdgram.cpp:216
↓ 1 callers
Function
get_mode
examples++/dgram_over_stream.cpp:41
↓ 1 callers
Function
run_client
examples++/dgram_over_stream.cpp:72
↓ 1 callers
Function
run_server
examples++/dgram_over_stream.cpp:121
↓ 1 callers
Function
run_string_client
examples++/dgram_over_stream.cpp:88
↓ 1 callers
Function
run_vec_client
examples++/dgram_over_stream.cpp:103
↓ 1 callers
Method
set_sock_opt
* @brief Set socket options on the underlying socket. * * @return The return value of setsockopt(2). * * Sets socket options using setsockopt(2).
C++/socket.cpp:101
↓ 1 callers
Function
shutdown_inet_stream_socket
* @brief Perform a `shutdown(2)` call on a socket * * If you're done with writing or reading from a socket * you may signalize this to the OS and/o
C/inet/libinetsocket.c:621
↓ 1 callers
Function
shutdown_unix_stream_socket
* @brief Shut a socket down * * Shut a socket down for reading or writing. If shut down for * reading, the program can't read anymore. If shut down
C/unix/libunixsocket.c:272
Method
accept
* @brief Accepts incoming connections on a UNIX domain stream server socket. * * @param flags Flags for Linux' `accept4()`; useless on other impleme
C++/unixserverstream.cpp:112
Method
accept2
* @brief Accepts an incoming connection on a UNIX domain stream server socket * and returns an owned pointer. * * The owned pointer will be closed
C++/unixserverstream.cpp:146
Method
add_fd
headers/select.hpp:146
Method
connect
* @brief Connect socket * * Connects a client stream socket. * * @param path The server socket's path * @param socket_flags Flags for `socket(2)`
C++/unixclientstream.cpp:89
Method
connect
* @brief Set up socket if not already done. * * Creates TCP/IP client socket and connects. Fails if the socket is already set * up. * * @param ds
C++/inetclientstream.cpp:98
Method
connect
* @brief Connect a UNIX datagram socket * * This function connects a datagram socket; `connect(2)` says the following * about this: * * > If the
C++/unixclientdgram.cpp:122
Method
deconnect
* @brief Disconnect a UNIX datagram socket * * Disconnects a previously connected socket. * */
C++/unixclientdgram.cpp:158
Method
del_fd
headers/epoll.hpp:159
Method
dgram_client_socket
C++/dgramclient.cpp:57
Method
dgram_over_stream
headers/dgramoverstream.hpp:82
Method
dgram_over_stream
C++/dgramoverstream.cpp:43
Method
enable_nagle
* @brief Set TCP_NODELAY to `!enabled` on the underlying socket. * * TCP_NODELAY causes writes to the socket to be pushed to the network * immediat
C++/dgramoverstream.cpp:66
Method
epollset
headers/epoll.hpp:75
Method
epollset
headers/epoll.hpp:102
Method
get_path
* @brief Returns the path we're bound or connected to */
C++/unixbase.cpp:50
Method
getconn
* @deprecated (use is_connected()) * * Look up if socket is connected. */
C++/dgramclient.cpp:198
Function
highestfd
UTIL *****/ * @brief Utility function to find the highest number in a vector (typically, * the highest file descriptor) */
C++/select.cpp:42
Method
inet_dgram_client
* @brief Create normal datagram socket (connectable). * * @param proto_osi3 `LIBSOCKET_IPv4` or `LIBSOCKET_IPv6` or `LIBSOCKET_BOTH` * @param flags
C++/inetclientdgram.cpp:69
Method
inet_dgram_server
* @brief Create datagram socket and bind it. * * @param host Bind address (Wildcard: "0.0.0.0"/"::") * @param port Bind port * @param proto_osi3 `
C++/inetserverdgram.cpp:60
Method
inet_socket
C++/inetbase.cpp:53
Method
inet_stream
Void constructor; call connect() before using the socket!
C++/inetclientstream.cpp:55
Method
inet_stream_server
* @brief Void constructor; don't forget to setup() the socket before use! */
C++/inetserverstream.cpp:60
Method
is_connected
* Returns true if the socket is in a connected state. */
C++/dgramclient.cpp:203
Function
main
examples++/echo_server.cpp:9
Function
main
examples++/unix_dgram_server.cpp:8
Function
main
examples++/dgram_over_stream.cpp:52
Function
main
examples++/client.cpp:16
Function
main
examples++/http_epoll.cpp:10
Function
main
examples++/echo_client_conn.cpp:10
Function
main
examples++/unix_dgram_client.cpp:8
Function
main
examples++/echo_client_sndto.cpp:11
Function
main
examples++/server.cpp:20
Function
main
examples++/http.cpp:9
Function
main
examples++/unix_client_stream.cpp:9
Function
main
examples++/http_2.cpp:8
Function
main
examples++/framing.cpp:9
Function
main
examples++/unix_server_stream.cpp:14
Function
main
examples++/unix_dgram_syslogclient.cpp:8
Function
main
examples/transmission_server.c:11
Function
main
examples/echo_dgram_client.c:15
Function
main
examples/http.c:16
Function
main
examples/unix_dgram_server.c:14
Function
main
examples/unix_stream_client.c:14
Function
main
examples/unix_dgram_client.c:14
Function
main
examples/unix_stream_server.c:14
Function
main
examples/multicast-listen.c:9
Function
main
examples/get_address_family.c:15
Function
main
examples/unix_dgram_connected_client.c:14
Function
main
examples/echo_dgram_server.c:19
Function
main
examples/transmission_client.c:11
Function
main
examples/echo_dgram_connect_client.c:14
Method
rcv
* @brief Receive data from socket * * ...and puts it in `buf`. * * @param buf A writable memory buffer of length `len` * @param len Length of `bu
C++/streamclient.cpp:68
Method
rcvfrom
* @brief Receives data from peer * * rcvfrom is the equivalent to `recvfrom(2)`. * * @param buf Target memory * @param len The size of the target
C++/inetdgram.cpp:79
Method
receive_bytes
Places up to n bytes into this->RECV_BUF.
C++/dgramoverstream.cpp:216
Method
receive_header
* @brief Receive and decode length header. * @returns The expected length received. * @throws socket_exception */
C++/dgramoverstream.cpp:240
next →
1–100 of 122, ranked by callers