|
@@ -88,7 +88,7 @@ void SctpTransport::Cleanup() {
|
|
|
SctpTransport::SctpTransport(std::shared_ptr<Transport> lower, uint16_t port,
|
|
|
message_callback recvCallback, amount_callback bufferedAmountCallback,
|
|
|
state_callback stateChangeCallback)
|
|
|
- : Transport(lower, std::move(stateChangeCallback)), mPort(port), mReceiving(false),
|
|
|
+ : Transport(lower, std::move(stateChangeCallback)), mPort(port),
|
|
|
mSendQueue(0, message_size_func), mBufferedAmountCallback(std::move(bufferedAmountCallback)) {
|
|
|
onRecv(recvCallback);
|
|
|
|
|
@@ -328,8 +328,6 @@ void SctpTransport::incoming(message_ptr message) {
|
|
|
void SctpTransport::doRecv() {
|
|
|
std::lock_guard lock(mRecvMutex);
|
|
|
try {
|
|
|
- scope_guard scope([this]() { mReceiving = false; });
|
|
|
- mReceiving = true;
|
|
|
while (true) {
|
|
|
const size_t bufferSize = 65536;
|
|
|
byte buffer[bufferSize];
|
|
@@ -541,7 +539,7 @@ void SctpTransport::handleUpcall() {
|
|
|
|
|
|
int events = usrsctp_get_events(mSock);
|
|
|
|
|
|
- if ((events & SCTP_EVENT_READ) && !mReceiving.exchange(true))
|
|
|
+ if (events & SCTP_EVENT_READ)
|
|
|
mProcessor.enqueue(&SctpTransport::doRecv, this);
|
|
|
|
|
|
if (events & SCTP_EVENT_WRITE)
|