Skip to content

Commit

Permalink
RELEASE v0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
amukhsimov committed Jan 9, 2021
1 parent a0ea6b7 commit 4db4f0f
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 22 deletions.
10 changes: 5 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
cmake_minimum_required(VERSION 3.17)
project(srt-server)
CMAKE_MINIMUM_REQUIRED(VERSION 3.17)
PROJECT(srt-server)

set(CMAKE_CXX_STANDARD 11)
SET(CMAKE_CXX_STANDARD 11)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthread")

add_executable(srt-server headers/structs.h headers/main.h source/core.cpp source/main.cpp source/environment.cpp)
target_link_libraries(srt-server -lsrt)
ADD_EXECUTABLE(srt-server headers/structs.h headers/main.h source/core.cpp source/main.cpp source/environment.cpp)
TARGET_LINK_LIBRARIES(srt-server -lsrt)

INSTALL(TARGETS srt-server)
43 changes: 33 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,41 @@


<h1>srt-server</h1>

<h3>Dependencies</h3>
- SRT (https://github.com/Haivision/srt)
- cmake > 3.17.2
<ul>
<li>SRT (https://github.com/Haivision/srt)</li>
<li>cmake > 3.17.2</li>
</ul>

<h3>Build</h3>
srt-server can only build under linux. Was tested under Ubuntu 20.04.
<div style="padding-left: 20px">
<h4>1. Build from source</h4>
srt-server can only build under linux. Was tested under Ubuntu 20.04.

```
Build SRT:
- git clone https://github.com/Haivision/srt.git
- sudo apt-get update
- sudo apt-get install -y tclsh pkg-config cmake libssl-dev build-essential
- ./configure --prefix=/usr
- make
- sudo make install
Build srt-server:
- git clone https://github.com/AKM2109/srt-server.git
- cmake .
- make
- sudo make install
```

<h4>2. Download release binaries</h4>

</div>

- git clone https://github.com/AKM2109/srt-server.git
- cmake .
- make
- sudo make install

<h3>Usage</h3>
<b>srt_server [PORT_RECEIVE PORT_SEND]</b>
<div style="padding-left: 20px">
<h4>srt-server [PORT_RECEIVE PORT_SEND]</h4>

if PORT_RECEIVE and PORT_SEND are not specified, by default server receives data on 9000 port and sends data from 9001 port
_if PORT_RECEIVE and PORT_SEND are not specified, by default server receives on port 9000 and sends on 9001_
</div>
Binary file removed bin/v0.1b.tar
Binary file not shown.
9 changes: 2 additions & 7 deletions source/core.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,19 +70,14 @@ void *connections_handler(void *ptr) {
sockaddr_storage clientaddr;
int addrlen = sizeof(clientaddr);

// Restriction, only one source accepted for now
if (src_count > 0) {
continue;
}

fhandle = srt_accept(sock_rcv, (sockaddr *) &clientaddr, &addrlen);
if (fhandle == SRT_INVALID_SOCK) {
// Set error message
snprintf(info->thread_info->msg_buff, WORKTHREAD_MSG_BUFF_LEN,
"[CONNTHREAD] rcv srt_accept error: %s; stopping thread...\n",
srt_getlasterror_str());
// Set thread closed and log error
set_thread_closed(info->thread_info, info->thread_info->msg_buff, LOG_ERR);
return nullptr;
continue;
}

char clienthost[NI_MAXHOST];
Expand Down

0 comments on commit 4db4f0f

Please sign in to comment.