Navin
Navin

Reputation: 534

UDT connection break during recv

My code works fine in windows but when i compile it in mac and run it, the connection breaks during recv.

I am using UDT RENDEZVOUS mode to connect which works perfectly

bool rendezvous = true;
UDT::setsockopt(serv, 0, UDT_RENDEZVOUS, &rendezvous, sizeof(bool));
UDT::bind(serv,socket_.native());

if (UDT::ERROR == UDT::connect(serv, (sockaddr*)&serv_addr, sizeof(serv_addr)))
{
std::cout << UDT::getsockstate(serv);
}

i am binding a boost socket with udt socket.

here my connection breaks, and the error says, socket closed, non-exist

if (UDT::ERROR == (rs = UDT::recv(serv, data_read_TCP_Style.retdata() + rsize, size - rsize , 0)))
{
cout << "recv:" << UDT::getlasterror().getErrorMessage() << endl;
}

why does the connection breaks only during recv? what could possibly effecting the connection?

Upvotes: 0

Views: 605

Answers (1)

owenismylove
owenismylove

Reputation: 9

set rendezvous = false,maybe can solve this question.

Upvotes: -1

Related Questions