Toggle navigation
Toggle navigation
此项目
正在载入...
Sign in
胡斌
/
srs
转到一个项目
Toggle navigation
项目
群组
代码片段
帮助
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
winlin
2015-10-13 17:37:59 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
20fcfb3eeed7940b77241b4c5667b3b28a704226
20fcfb3e
1 parent
69cc01b6
fix bug, use system utility
隐藏空白字符变更
内嵌
并排对比
正在显示
8 个修改的文件
包含
41 行增加
和
13 行删除
trunk/src/app/srs_app_caster_flv.cpp
trunk/src/app/srs_app_caster_flv.hpp
trunk/src/app/srs_app_mpegts_udp.cpp
trunk/src/app/srs_app_mpegts_udp.hpp
trunk/src/app/srs_app_rtsp.cpp
trunk/src/app/srs_app_rtsp.hpp
trunk/src/app/srs_app_st.cpp
trunk/src/app/srs_app_st.hpp
trunk/src/app/srs_app_caster_flv.cpp
查看文件 @
20fcfb3
...
...
@@ -273,8 +273,8 @@ int SrsDynamicHttpConn::connect()
}
// connect host.
if
((
ret
=
srs_socket_connect
(
req
->
host
,
::
atoi
(
req
->
port
.
c_str
()),
ST_UTIME_NO_TIMEOUT
,
&
stfd
))
!=
ERROR_SUCCESS
)
{
srs_error
(
"mpegts: connect server %s:%s failed. ret=%d"
,
req
->
host
.
c_str
(),
req
->
port
.
c_str
(),
ret
);
if
((
ret
=
srs_socket_connect
(
req
->
host
,
req
->
port
,
ST_UTIME_NO_TIMEOUT
,
&
stfd
))
!=
ERROR_SUCCESS
)
{
srs_error
(
"mpegts: connect server %s:%d failed. ret=%d"
,
req
->
host
.
c_str
(),
req
->
port
,
ret
);
return
ret
;
}
io
=
new
SrsStSocket
(
stfd
);
...
...
@@ -308,7 +308,7 @@ int SrsDynamicHttpConn::connect()
}
// TODO: FIXME: refine the connect_app.
int
SrsDynamicHttpConn
::
connect_app
(
string
ep_server
,
string
ep_port
)
int
SrsDynamicHttpConn
::
connect_app
(
string
ep_server
,
int
ep_port
)
{
int
ret
=
ERROR_SUCCESS
;
...
...
trunk/src/app/srs_app_caster_flv.hpp
查看文件 @
20fcfb3
...
...
@@ -104,7 +104,7 @@ private:
// connect to rtmp output url.
// @remark ignore when not connected, reconnect when disconnected.
virtual
int
connect
();
virtual
int
connect_app
(
std
::
string
ep_server
,
std
::
string
ep_port
);
virtual
int
connect_app
(
std
::
string
ep_server
,
int
ep_port
);
// close the connected io and rtmp to ready to be re-connect.
virtual
void
close
();
};
...
...
trunk/src/app/srs_app_mpegts_udp.cpp
查看文件 @
20fcfb3
...
...
@@ -616,8 +616,8 @@ int SrsMpegtsOverUdp::connect()
}
// connect host.
if
((
ret
=
srs_socket_connect
(
req
->
host
,
::
atoi
(
req
->
port
.
c_str
()),
ST_UTIME_NO_TIMEOUT
,
&
stfd
))
!=
ERROR_SUCCESS
)
{
srs_error
(
"mpegts: connect server %s:%s failed. ret=%d"
,
req
->
host
.
c_str
(),
req
->
port
.
c_str
(),
ret
);
if
((
ret
=
srs_socket_connect
(
req
->
host
,
req
->
port
,
ST_UTIME_NO_TIMEOUT
,
&
stfd
))
!=
ERROR_SUCCESS
)
{
srs_error
(
"mpegts: connect server %s:%d failed. ret=%d"
,
req
->
host
.
c_str
(),
req
->
port
,
ret
);
return
ret
;
}
io
=
new
SrsStSocket
(
stfd
);
...
...
@@ -651,7 +651,7 @@ int SrsMpegtsOverUdp::connect()
}
// TODO: FIXME: refine the connect_app.
int
SrsMpegtsOverUdp
::
connect_app
(
string
ep_server
,
string
ep_port
)
int
SrsMpegtsOverUdp
::
connect_app
(
string
ep_server
,
int
ep_port
)
{
int
ret
=
ERROR_SUCCESS
;
...
...
trunk/src/app/srs_app_mpegts_udp.hpp
查看文件 @
20fcfb3
...
...
@@ -126,7 +126,7 @@ private:
// connect to rtmp output url.
// @remark ignore when not connected, reconnect when disconnected.
virtual
int
connect
();
virtual
int
connect_app
(
std
::
string
ep_server
,
std
::
string
ep_port
);
virtual
int
connect_app
(
std
::
string
ep_server
,
int
ep_port
);
// close the connected io and rtmp to ready to be re-connect.
virtual
void
close
();
};
...
...
trunk/src/app/srs_app_rtsp.cpp
查看文件 @
20fcfb3
...
...
@@ -648,7 +648,8 @@ int SrsRtspConn::connect()
// parse uri
if
(
!
req
)
{
std
::
string
schema
,
host
,
vhost
,
app
,
port
,
param
;
std
::
string
schema
,
host
,
vhost
,
app
,
param
;
int
port
;
srs_discovery_tc_url
(
rtsp_tcUrl
,
schema
,
host
,
vhost
,
app
,
port
,
param
);
// generate output by template.
...
...
@@ -662,8 +663,8 @@ int SrsRtspConn::connect()
}
// connect host.
if
((
ret
=
srs_socket_connect
(
req
->
host
,
::
atoi
(
req
->
port
.
c_str
()),
ST_UTIME_NO_TIMEOUT
,
&
stfd
))
!=
ERROR_SUCCESS
)
{
srs_error
(
"rtsp: connect server %s:%s failed. ret=%d"
,
req
->
host
.
c_str
(),
req
->
port
.
c_str
(),
ret
);
if
((
ret
=
srs_socket_connect
(
req
->
host
,
req
->
port
,
ST_UTIME_NO_TIMEOUT
,
&
stfd
))
!=
ERROR_SUCCESS
)
{
srs_error
(
"rtsp: connect server %s:%d failed. ret=%d"
,
req
->
host
.
c_str
(),
req
->
port
,
ret
);
return
ret
;
}
io
=
new
SrsStSocket
(
stfd
);
...
...
@@ -697,7 +698,7 @@ int SrsRtspConn::connect()
}
// TODO: FIXME: refine the connect_app.
int
SrsRtspConn
::
connect_app
(
string
ep_server
,
string
ep_port
)
int
SrsRtspConn
::
connect_app
(
string
ep_server
,
int
ep_port
)
{
int
ret
=
ERROR_SUCCESS
;
...
...
trunk/src/app/srs_app_rtsp.hpp
查看文件 @
20fcfb3
...
...
@@ -181,7 +181,7 @@ private:
// connect to rtmp output url.
// @remark ignore when not connected, reconnect when disconnected.
virtual
int
connect
();
virtual
int
connect_app
(
std
::
string
ep_server
,
std
::
string
ep_port
);
virtual
int
connect_app
(
std
::
string
ep_server
,
int
ep_port
);
};
/**
...
...
trunk/src/app/srs_app_st.cpp
查看文件 @
20fcfb3
...
...
@@ -23,6 +23,9 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include <srs_app_st.hpp>
#include <string>
using
namespace
std
;
#include <srs_kernel_error.hpp>
#include <srs_kernel_log.hpp>
...
...
@@ -406,6 +409,20 @@ int SrsStSocket::writev(const iovec *iov, int iov_size, ssize_t* nwrite)
return
ret
;
}
SrsTcpClient
::
SrsTcpClient
()
{
}
SrsTcpClient
::~
SrsTcpClient
()
{
}
int
SrsTcpClient
::
connect
(
string
host
,
int
port
,
int64_t
timeout
)
{
int
ret
=
ERROR_SUCCESS
;
return
ret
;
}
#ifdef __linux__
#include <sys/epoll.h>
...
...
trunk/src/app/srs_app_st.hpp
查看文件 @
20fcfb3
...
...
@@ -30,6 +30,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include <srs_core.hpp>
#include <string>
#include <st.h>
#include <srs_app_st.hpp>
...
...
@@ -211,6 +213,14 @@ class SrsTcpClient
public
:
SrsTcpClient
();
virtual
~
SrsTcpClient
();
public
:
/**
* connect to server over TCP.
* @param host the ip or hostname of server.
* @param port the port to connect to.
* @param timeout the timeout in us.
*/
virtual
int
connect
(
std
::
string
host
,
int
port
,
int64_t
timeout
);
};
// initialize st, requires epoll.
...
...
请
注册
或
登录
后发表评论