NetSim Source Code Help
Loading...
Searching...
No Matches
Socket.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <Ws2tcpip.h>
#include <synchapi.h>
#include <windows.h>
#include <stdbool.h>
#include <signal.h>
#include "CLI.h"
Include dependency graph for Socket.c:

Go to the source code of this file.

Macros

#define _CRT_SECURE_NO_WARNINGS
 
#define DEFAULT_BUFLEN   1024
 
#define DEFAULT_PORT   "8999"
 

Functions

void send_to_socket (ptrCLIENTINFO info, char *buf, int len)
 
DWORD WINAPI listen_for_client (LPVOID lpParam)
 
void init_socket ()
 
DWORD WINAPI command_recv_process (LPVOID lpParam)
 

Variables

WSADATA wsa
 
SOCKET listenSocket
 
HANDLE listenThread
 
DWORD listenThreadId
 

Macro Definition Documentation

◆ _CRT_SECURE_NO_WARNINGS

#define _CRT_SECURE_NO_WARNINGS

Definition at line 1 of file Socket.c.

◆ DEFAULT_BUFLEN

#define DEFAULT_BUFLEN   1024

Definition at line 16 of file Socket.c.

◆ DEFAULT_PORT

#define DEFAULT_PORT   "8999"

Definition at line 17 of file Socket.c.

Function Documentation

◆ command_recv_process()

DWORD WINAPI command_recv_process ( LPVOID  lpParam)

Definition at line 130 of file Socket.c.

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

◆ init_socket()

void init_socket ( )

Definition at line 116 of file Socket.c.

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

◆ listen_for_client()

DWORD WINAPI listen_for_client ( LPVOID  lpParam)

Definition at line 33 of file Socket.c.

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

◆ send_to_socket()

void send_to_socket ( ptrCLIENTINFO  info,
char *  buf,
int  len 
)

Definition at line 22 of file Socket.c.

Here is the caller graph for this function:

Variable Documentation

◆ listenSocket

SOCKET listenSocket

Definition at line 15 of file Socket.c.

◆ listenThread

HANDLE listenThread

Definition at line 19 of file Socket.c.

◆ listenThreadId

DWORD listenThreadId

Definition at line 20 of file Socket.c.

◆ wsa

WSADATA wsa

Definition at line 14 of file Socket.c.