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
2014-03-02 09:28:44 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
feaf0c5e8933fc444b647824663837525530f1a8
feaf0c5e
1 parent
f8335e2c
librtmp: create socket
隐藏空白字符变更
内嵌
并排对比
正在显示
2 个修改的文件
包含
29 行增加
和
3 行删除
trunk/src/libs/srs_lib_simple_socket.cpp
trunk/src/libs/srs_lib_simple_socket.hpp
trunk/src/libs/srs_lib_simple_socket.cpp
查看文件 @
feaf0c5
...
...
@@ -23,9 +23,32 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include <srs_lib_simple_socket.hpp>
SimpleSocketStream
::
SimpleSocketStream
(
int
fd
)
{
#include <srs_kernel_error.hpp>
#include <unistd.h>
#include <sys/types.h>
#include <sys/socket.h>
SimpleSocketStream
::
SimpleSocketStream
()
{
fd
=
-
1
;
}
SimpleSocketStream
::~
SimpleSocketStream
()
{
SimpleSocketStream
::~
SimpleSocketStream
()
{
if
(
fd
!=
-
1
)
{
::
close
(
fd
);
fd
=
-
1
;
}
}
int
SimpleSocketStream
::
create_socket
()
{
fd
=
::
socket
(
AF_INET
,
SOCK_STREAM
,
0
);
if
(
fd
==
-
1
){
return
-
1
;
}
return
ERROR_SUCCESS
;
}
...
...
trunk/src/libs/srs_lib_simple_socket.hpp
查看文件 @
feaf0c5
...
...
@@ -33,10 +33,13 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
class
SimpleSocketStream
{
private
:
int
fd
;
public
:
SimpleSocketStream
(
int
fd
);
SimpleSocketStream
();
virtual
~
SimpleSocketStream
();
public
:
virtual
int
create_socket
();
};
#endif
...
...
请
注册
或
登录
后发表评论