udp/tcp 비동기 통신은 현재 가능
This commit is contained in:
@@ -61,8 +61,19 @@ struct IOCPPASSINDATA {
|
||||
event = IOCPEVENT::QUIT;
|
||||
socket = nullptr;
|
||||
ssl = std::shared_ptr<SSL>(::SSL_new(ctx), ::SSL_free);
|
||||
::SSL_set_bio(ssl.get(), ::BIO_new(::BIO_s_mem()),
|
||||
::BIO_new(::BIO_s_mem()));
|
||||
if (ssl == nullptr) {
|
||||
throw std::runtime_error("SSL_new failed. Check SSL_CTX or memory.");
|
||||
}
|
||||
BIO* rbio = BIO_new(BIO_s_mem());
|
||||
BIO* wbio = BIO_new(BIO_s_mem());
|
||||
|
||||
if (!rbio || !wbio) {
|
||||
BIO_free(rbio);
|
||||
BIO_free(wbio);
|
||||
throw std::runtime_error("BIO_new failed");
|
||||
}
|
||||
|
||||
SSL_set_bio(ssl.get(), rbio, wbio);
|
||||
transferredbytes = 0;
|
||||
this->bufsize = bufsize;
|
||||
IOCPInstance = nullptr;
|
||||
@@ -122,7 +133,8 @@ class IOCP {
|
||||
|
||||
void destruct();
|
||||
|
||||
void registerSocket(IOCPPASSINDATA* data);
|
||||
void registerTCPSocket(IOCPPASSINDATA* data);
|
||||
void registerUDPSocket(IOCPPASSINDATA* data, Address recv_addr);
|
||||
|
||||
int recv(IOCPPASSINDATA* data);
|
||||
// data는 한 가지 소켓에 보내는 패킷만 담아야 합니다
|
||||
|
||||
Reference in New Issue
Block a user