change typedef
This commit is contained in:
@@ -1,6 +1,3 @@
|
||||
|
||||
|
||||
#include <functional>
|
||||
#include <string>
|
||||
#include <netinet/in.h>
|
||||
|
||||
@@ -22,7 +19,7 @@ namespace TcpSocket
|
||||
int remotePort(sockaddr_in &address);
|
||||
int connectt(const char *host, uint16_t port);
|
||||
|
||||
typedef std::function<void(int sock, sockaddr_in newSocketInfo)> OnNewConnectionCallBack;
|
||||
typedef void(OnNewConnectionCallBack)(int sock, sockaddr_in newSocketInfo);
|
||||
int listent(const char *host, uint16_t port, OnNewConnectionCallBack callback);
|
||||
|
||||
} // namespace TcpSocket
|
||||
|
@@ -1,3 +1,4 @@
|
||||
#include "TcpSocket.hpp"
|
||||
|
||||
#include <arpa/inet.h>
|
||||
#include <sys/socket.h>
|
||||
@@ -95,8 +96,6 @@ namespace TcpSocket
|
||||
return sock;
|
||||
}
|
||||
|
||||
typedef std::function<void(int sock, sockaddr_in newSocketInfo)> OnNewConnectionCallBack;
|
||||
|
||||
int listent(const char *host, uint16_t port, OnNewConnectionCallBack callback)
|
||||
{
|
||||
sockaddr_in address;
|
||||
|
Reference in New Issue
Block a user