created structs Client and Server

This commit is contained in:
2025-11-09 03:36:50 +05:00
parent 96a117bc50
commit e03c651cef
15 changed files with 234 additions and 184 deletions

View File

@@ -15,6 +15,8 @@ void EncryptedSocketTCP_construct(EncryptedSocketTCP* ptr,
}
void EncryptedSocketTCP_destroy(EncryptedSocketTCP* ptr){
if(!ptr)
return;
socket_close(ptr->sock);
free(ptr->recv_buf.data);
free(ptr->send_buf.data);
@@ -161,6 +163,9 @@ void EncryptedSocketUDP_construct(EncryptedSocketUDP* ptr,
}
void EncryptedSocketUDP_destroy(EncryptedSocketUDP* ptr){
if(!ptr)
return;
socket_close(ptr->sock);
free(ptr->recv_buf.data);
free(ptr->send_buf.data);

View File

@@ -21,6 +21,7 @@
#include <sys/socket.h>
#include <sys/time.h>
#include <netinet/in.h>
#include <netinet/tcp.h>
#include <arpa/inet.h>
#include <netdb.h>
#include <unistd.h>