implemented ServerPublicInfoResponse and ProgramMode::RandomBytes
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
#pragma once
|
||||
#include "tlibc/errors.h"
|
||||
#include "endpoint.h"
|
||||
#include "network.h"
|
||||
|
||||
#if !defined(KN_USE_WINSOCK)
|
||||
#if defined(_WIN64) || defined(_WIN32)
|
||||
@@ -30,10 +31,10 @@
|
||||
|
||||
#if KN_USE_WINSOCK
|
||||
#define RESULT_ERROR_SOCKET()\
|
||||
RESULT_ERROR(sprintf_malloc(64, "Winsock error %i (look in <winerror.h>)", WSAGetLastError()), true);
|
||||
RESULT_ERROR_CODE_FMT(WINSOCK2, WSAGetLastError(), "Winsock error %i (look in <winerror.h>)", WSAGetLastError());
|
||||
#else
|
||||
#define RESULT_ERROR_SOCKET()\
|
||||
RESULT_ERROR(strerror(errno), false);
|
||||
RESULT_ERROR_ERRNO();
|
||||
#endif
|
||||
|
||||
struct sockaddr_in EndpointIPv4_toSockaddr(EndpointIPv4 end);
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
#include "network.h"
|
||||
#include "internal.h"
|
||||
|
||||
ErrorCodePage_define(WINSOCK2);
|
||||
|
||||
Result(void) network_init(){
|
||||
#if _WIN32
|
||||
ErrorCodePage_register(WINSOCK2);
|
||||
// Initialize Winsock
|
||||
WSADATA wsaData = {0};
|
||||
int result = WSAStartup(MAKEWORD(2,2), &wsaData);
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
#pragma once
|
||||
#include "tlibc/errors.h"
|
||||
|
||||
ErrorCodePage_declare(WINSOCK2);
|
||||
|
||||
Result(void) network_init();
|
||||
void network_deinit();
|
||||
|
||||
Reference in New Issue
Block a user