diff --git a/gsock.cpp b/gsock.cpp index d5323bb..ed050a9 100644 --- a/gsock.cpp +++ b/gsock.cpp @@ -235,6 +235,11 @@ int vsock::setNonblocking() } } +bool vsock::isNonblocking() +{ + return _vp->nonblocking; +} + vsock::~vsock() { if(_vp) @@ -1040,7 +1045,8 @@ void NBAcceptResult::_impl::update() if (ret >= 0) { - *out_binding_sfd = sfd; + // This is a BUG!! Fixed. + *out_binding_sfd = ret; *out_binding_created = true; status = 2; } diff --git a/gsock.h b/gsock.h index 52dd537..078ee45 100644 --- a/gsock.h +++ b/gsock.h @@ -49,6 +49,7 @@ class vsock { public: int setNonblocking(); + bool isNonblocking(); protected: vsock(); vsock(const vsock&)=delete;