Shadow Network Framework
0.0.1-alpha
C Server Library for Shadow Network Framework
|
This file Defines everything related to networking. More...
Go to the source code of this file.
Macros | |
#define | _SNF_VER "0.0.1-alpha" |
Defines the library's version. | |
#define | SNF_Total_Data (SNF_Total_Data_Rcv + SNF_Total_Data_Snt) |
Macro that defines the Total data tranferred so far. | |
#define | UNIT_SCEPARATOR "\x1F" |
Character that sceparates each argument (To be Removed) | |
#define | snf_rcv(Client, Buffer, _Size) snf_rcv_(Client, Buffer, _Size, 0) |
Same as snf_rcv_ how ever _Flags will be 0. | |
#define | snf_rcv_PEEK(Client, Buffer, _Size) snf_rcv_(Client, Buffer, _Size, MSG_PEEK) |
Same as snf_rcv_ how ever _Flags will be MSG_PEEK. | |
Functions | |
void | snf_network_init () |
Initializes the Network Framwork. | |
void | snf_network_join () |
See snf_thpool_join (Works on the Ntwrk Thread Pool) | |
int | snf_snd (SNF_CLT *Client, const char *Buffer, int _Size) |
Sends a Buffer to Client's SNF_CLT::sock. | |
int | snf_rcv_ (SNF_CLT *Client, void *Buffer, int _Size, int _Flags) |
Receives a Buffer from Client's SNF_CLT::sock. | |
Variables | |
thpool * | Ntwrk |
The thread pool that controls the working of the Framework. | |
int | SNF_PORT |
Defines the Framework's TCP/IP's port. | |
int | SNF_MAX_QUEUE |
Max Queue allowed to wait to be accepted at once. | |
int | SNF_SERVER_SOCKET |
the main Socket that accepts new incoming connections | |
struct sockaddr_in | SNF_SERVER_ADDR |
Structure that saves the Server's sockaddr_in. | |
struct sockaddr_in | SNF_CLIENT_ADDR |
Structure that saves the Client's sockaddr_in. | |
socklen_t | SNF_CLIENT_LEN |
Used for accept's length argument. | |
_Atomic uint64_t | SNF_Total_Data_Rcv |
Saves the Total data received so far. | |
_Atomic uint64_t | SNF_Total_Data_Snt |
Saves the Total data sent so far. | |
This file Defines everything related to networking.
#define _SNF_VER "0.0.1-alpha" |
Defines the library's version.
#define SNF_Total_Data (SNF_Total_Data_Rcv + SNF_Total_Data_Snt) |
Macro that defines the Total data tranferred so far.
#define UNIT_SCEPARATOR "\x1F" |
Character that sceparates each argument (To be Removed)
#define snf_rcv | ( | Client, | |
Buffer, | |||
_Size ) snf_rcv_(Client, Buffer, _Size, 0) |
Same as snf_rcv_ how ever _Flags will be 0.
#define snf_rcv_PEEK | ( | Client, | |
Buffer, | |||
_Size ) snf_rcv_(Client, Buffer, _Size, MSG_PEEK) |
Same as snf_rcv_ how ever _Flags will be MSG_PEEK.
|
extern |
Initializes the Network Framwork.
|
extern |
See snf_thpool_join (Works on the Ntwrk Thread Pool)
|
extern |
Sends a Buffer to Client's SNF_CLT::sock.
Client | Pointer to the Client's SNF_CLT instance |
Buffer | Buffer to send |
_Size | Size of the Buffer (See Note ) |
|
extern |
Receives a Buffer from Client's SNF_CLT::sock.
Client | Pointer to the Client's SNF_CLT instance |
Buffer | Received Buffer |
_Size | Expected Size |
_Flags | Flags that will be passed to recv() |
|
extern |
The thread pool that controls the working of the Framework.
|
extern |
Defines the Framework's TCP/IP's port.
|
extern |
Max Queue allowed to wait to be accepted at once.
|
extern |
the main Socket that accepts new incoming connections
|
extern |
Structure that saves the Server's sockaddr_in.
|
extern |
Structure that saves the Client's sockaddr_in.
|
extern |
Used for accept's length argument.
|
extern |
Saves the Total data received so far.
|
extern |
Saves the Total data sent so far.