Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how to avoid program exiting #23

Open
cafecai opened this issue Jun 8, 2019 · 4 comments
Open

how to avoid program exiting #23

cafecai opened this issue Jun 8, 2019 · 4 comments

Comments

@cafecai
Copy link

cafecai commented Jun 8, 2019

When the rtsp server is restarted and disconnected, the socket is interrupted. The following prompt appears. When I try to reconnect in the program, the program exits.
How can I solve the problem and avoid the program exiting, but I can reconnect to the rtsp server.

Adding destination
Deleting destination
No RTP data
: Error sending over socket 25, removing destination
No RTP data
No RTP data
No RTP data
No RTP data
No RTP data

@cafecai
Copy link
Author

cafecai commented Jun 8, 2019

while(1)
{
string RtspUri(pstVdecSend->cFileName);
Client.SetURI(RtspUri);
Client.DoDESCRIBE();
Client.ParseSDP();
Client.DoSETUP("video", true);
//Client.SetVideoByeFromServerClbk(ByeFromServerClbk);
printf("start PLAY\n");
//printf("SDP: %s\n", Client.GetSDP().c_str());
Client.DoPLAY("video");
int i=0,j=0;
while(1)
{
if(!Client.GetMediaData("video", pbuf, &size, BufSize))
{
sleep(1);
if(j++==5)
{
j=0;
break;
}
continue;
}
if(size>0)
{
play_frame()
}
if(pstVdecSend->bSettingsChanged||pstVdecSend->eCtrlSinal==VDEC_CTRL_STOP)
{
pstVdecSend->bSettingsChanged=HI_FALSE;
break;
}
/*
if(ByeFromServerFlag) {
break;
}
*/

}
Client.DoTEARDOWN();
if(pstVdecSend->eCtrlSinal==VDEC_CTRL_STOP)
	break;

}

@Ansersion
Copy link
Owner

Use a new RtspClient

@cafecai
Copy link
Author

cafecai commented Jun 10, 2019

I see, thank you! So how do I detect that the server has been disconnected? Is there an interface to check the connection?

@Ansersion
Copy link
Owner

ByeFromServerClbk will be called when the server disconnected

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants