mirror of
https://github.com/BeamMP/BeamMP-Server.git
synced 2026-04-16 21:30:12 +00:00
add udpserver, tcpserver
This commit is contained in:
committed by
Anonymous275
parent
f19a012509
commit
bf74b1ae32
@@ -4,13 +4,18 @@
|
||||
|
||||
#ifdef __unix
|
||||
#include <arpa/inet.h>
|
||||
#include <sys/socket.h>
|
||||
#include <termios.h>
|
||||
#include <unistd.h>
|
||||
using SOCKET = int;
|
||||
using DWORD = unsigned long;
|
||||
using PDWORD = unsigned long*;
|
||||
using LPDWORD = unsigned long*;
|
||||
char _getch(void);
|
||||
char _getch();
|
||||
inline void CloseSocketProper(int socket) {
|
||||
shutdown(socket, SHUT_RDWR);
|
||||
close(socket);
|
||||
}
|
||||
#endif // unix
|
||||
|
||||
// ======================= WIN32 =======================
|
||||
@@ -18,6 +23,10 @@ char _getch(void);
|
||||
#ifdef WIN32
|
||||
#include <conio.h>
|
||||
#include <windows.h>
|
||||
inline void CloseSocketProper(int socket) {
|
||||
shutdown(socket, SHUT_RDWR);
|
||||
close(socket);
|
||||
}
|
||||
#endif // WIN32
|
||||
|
||||
// ======================= OTHER =======================
|
||||
@@ -25,4 +34,3 @@ char _getch(void);
|
||||
#if !defined(WIN32) && !defined(__unix)
|
||||
#error "OS not supported"
|
||||
#endif
|
||||
|
||||
|
||||
Reference in New Issue
Block a user