1
0
Fork 0
mirror of https://github.com/ossrs/srs.git synced 2025-03-09 15:49:59 +00:00

srs-librtmp: implements handshake.

This commit is contained in:
winlin 2014-03-02 12:35:15 +08:00
parent f24f27deb9
commit 86267f854c
9 changed files with 83 additions and 39 deletions

View file

@ -233,13 +233,31 @@ int SrsRtmpClient::handshake()
SrsComplexHandshake complex_hs;
SrsSimpleHandshake simple_hs;
if ((ret = simple_hs.handshake_with_server(io, complex_hs)) != ERROR_SUCCESS) {
if ((ret = simple_hs.handshake_with_server(io, &complex_hs)) != ERROR_SUCCESS) {
return ret;
}
return ret;
}
int SrsRtmpClient::simple_handshake()
{
int ret = ERROR_SUCCESS;
SrsSimpleHandshake simple_hs;
if ((ret = simple_hs.handshake_with_server(io, NULL)) != ERROR_SUCCESS) {
return ret;
}
return ret;
}
int SrsRtmpClient::complex_handshake()
{
// TODO: FIXME: only use complex handshake.
return handshake();
}
int SrsRtmpClient::connect_app(string app, string tc_url)
{
int ret = ERROR_SUCCESS;
@ -495,7 +513,7 @@ int SrsRtmp::handshake()
SrsComplexHandshake complex_hs;
SrsSimpleHandshake simple_hs;
if ((ret = simple_hs.handshake_with_client(io, complex_hs)) != ERROR_SUCCESS) {
if ((ret = simple_hs.handshake_with_client(io, &complex_hs)) != ERROR_SUCCESS) {
return ret;
}