Skip to content

Commit 6a1fd59

Browse files
Merge pull request #51 from connectivecpp/develop
Merge dev to master to pull in VC++ build changes
2 parents 6ee9793 + 0a054fa commit 6a1fd59

File tree

14 files changed

+107
-17
lines changed

14 files changed

+107
-17
lines changed

.github/workflows/build_cmake.yml

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
# Note differences between Unix variants and Windows shell when invoking
2+
# multiple commands on one line - bash uses double ampersand, powershell
3+
# uses semi-colon
4+
#
5+
# Currently there is duplication, specially for the dependency management,
6+
# this should be refactored in the future
7+
#
8+
name: CMake Build Matrix
9+
10+
on:
11+
push:
12+
branches:
13+
- master
14+
- develop
15+
16+
jobs:
17+
18+
build-unixes:
19+
20+
runs-on: ${{ matrix.os }}
21+
strategy:
22+
matrix:
23+
os: [ubuntu-latest, macos-latest]
24+
25+
steps:
26+
- name: checkout
27+
uses: actions/checkout@v2
28+
with:
29+
path: main
30+
- name: checkout-utility-rack
31+
uses: actions/checkout@v2
32+
with:
33+
repository: connectivecpp/utility-rack
34+
path: utility-rack
35+
- name: checkout-catch
36+
uses: actions/checkout@v2
37+
with:
38+
repository: catchorg/Catch2
39+
ref: master
40+
path: Catch2
41+
- name: checkout-asio
42+
uses: actions/checkout@v2
43+
with:
44+
repository: chriskohlhoff/asio
45+
ref: master
46+
path: asio
47+
- name: configure-cmake
48+
run: mkdir build && cd build && cmake ../main
49+
- name: build
50+
run: cd build && cmake --build .
51+
- name: unit-test
52+
run: cd build && ctest
53+
54+
build-windows:
55+
56+
runs-on: windows-latest
57+
58+
steps:
59+
- name: checkout
60+
uses: actions/checkout@v2
61+
with:
62+
path: main
63+
- name: checkout-utility-rack
64+
uses: actions/checkout@v2
65+
with:
66+
repository: connectivecpp/utility-rack
67+
path: utility-rack
68+
- name: checkout-catch
69+
uses: actions/checkout@v2
70+
with:
71+
repository: catchorg/Catch2
72+
ref: master
73+
path: Catch2
74+
- name: checkout-asio
75+
uses: actions/checkout@v2
76+
with:
77+
repository: chriskohlhoff/asio
78+
ref: master
79+
path: asio
80+
- name: configure-cmake
81+
run: mkdir build; cd build; cmake ../main
82+
- name: build
83+
run: cd build; cmake --build .
84+
- name: unit-test
85+
run: cd build; ctest -C "Debug"

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
# CMake 3.8 required for cxx_std_17 target_compile_features
99

10-
cmake_minimum_required ( VERSION 3.8 )
10+
cmake_minimum_required ( VERSION 3.12 )
1111

1212
option ( CHOPS_NET_IP_OPT_BUILD_TESTS "Build and perform chops-net-ip tests" ON )
1313
option ( CHOPS_NET_IP_OPT_BUILD_EXAMPLES "Build and perform chops-net-ip examples" ON )

README.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,14 @@ Chops Net IP is layered on top of the Asio asynchronous networking library, taki
88

99
# Build and Release Status, License Info
1010

11-
Branch | Status
12-
|---|---|
13-
**Master** | [![Build Status](https://travis-ci.org/connectivecpp/chops-net-ip.svg?branch=master)](https://travis-ci.org/connectivecpp/chops-net-ip)
14-
**Develop** | [![Build Status](https://travis-ci.org/connectivecpp/chops-net-ip.svg?branch=develop)](https://travis-ci.org/connectivecpp/chops-net-ip)
11+
**Travis CI Build Status:**
12+
13+
*Master Branch* | [![Build Status](https://travis-ci.org/connectivecpp/chops-net-ip.svg?branch=master)](https://travis-ci.org/connectivecpp/chops-net-ip)
14+
*Develop Branch* | [![Build Status](https://travis-ci.org/connectivecpp/chops-net-ip.svg?branch=develop)](https://travis-ci.org/connectivecpp/chops-net-ip)
15+
16+
**GitHub Actions CI Build Status:**
17+
18+
![CMake Build Matrix](https://github.com/connectivecpp/chops-net-ip/workflows/CMake%20Build%20Matrix/badge.svg)
1519

1620
**Latest tag:** ![Latest Tag](https://img.shields.io/github/v/tag/connectivecpp/chops-net-ip)
1721

doc/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
# Distributed under the Boost Software License, Version 1.0.
66
# (See accompanying file LICENSE.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
77

8-
cmake_minimum_required ( VERSION 3.9 )
8+
cmake_minimum_required ( VERSION 3.12 )
99

1010
project ( chops-net-ip-doc VERSION 1.0 LANGUAGES CXX )
1111

example/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
# Distributed under the Boost Software License, Version 1.0.
66
# (See accompanying file LICENSE.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
77

8-
cmake_minimum_required ( VERSION 3.8 )
8+
cmake_minimum_required ( VERSION 3.12 )
99

1010
project ( chops-net-ip-example VERSION 1.0 LANGUAGES CXX )
1111

example/echo_binary_text_server_demo.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ int main(int argc, char* argv[]) {
103103
// create buffer to send altered text back to client
104104
chops::mutable_shared_buffer buf_out;
105105
// 1st 2 bytes are the size of the message
106-
uint16_t size_val = s.size();
106+
uint16_t size_val = static_cast<uint16_t>(s.size());
107107
// endian correct data marshalling
108108
std::byte tbuf[HDR_SIZE]; // temp buffer to hold the header
109109
// write those 2 bytes to the temp buffer

include/net_ip/detail/tcp_io.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ class tcp_io : public std::enable_shared_from_this<tcp_io> {
174174
}
175175
m_io_common.clear();
176176
std::error_code ec;
177-
m_socket.shutdown(asio::ip::tcp::socket::shutdown_both, ec);
177+
m_socket.shutdown(asio::ip::tcp::socket::shutdown_receive, ec);
178178
m_socket.close(ec);
179179
// notify the acceptor or connector that this tcp_io object is closed
180180
m_notifier_cb(err, shared_from_this());
@@ -298,7 +298,7 @@ inline void tcp_io::start_write(const chops::const_shared_buffer& buf) {
298298
inline void tcp_io::handle_write(const std::error_code& err, std::size_t /* num_bytes */) {
299299
if (err) {
300300
// read pops first, so usually no error is needed in write handlers
301-
// m_notifier_cb(err, shared_from_this());
301+
close(err);
302302
return;
303303
}
304304
m_io_common.write_next_elem([this] (const chops::const_shared_buffer& buf) {

test/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
# Distributed under the Boost Software License, Version 1.0.
66
# (See accompanying file LICENSE.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
77

8-
cmake_minimum_required ( VERSION 3.8 )
8+
cmake_minimum_required ( VERSION 3.12 )
99

1010
project ( chops-net-ip-test VERSION 1.0 LANGUAGES CXX )
1111

test/net_ip/detail/output_queue_test.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ void output_queue_test(const std::vector<E>& data_vec, int multiplier) {
5050
REQUIRE (qs.output_queue_size == tot);
5151
REQUIRE (qs.bytes_in_output_queue == chops::test::accum_io_buf_size(data_vec) * multiplier);
5252

53-
chops::repeat(tot, [&outq] {
53+
chops::repeat(static_cast<int>(tot), [&outq] {
5454
auto e = outq.get_next_element();
5555
// REQUIRE (e);
5656
assert (e);

test/net_ip/detail/tcp_acceptor_test.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@
6060
using namespace chops::test;
6161

6262
const char* test_port = "30434";
63-
const char* test_host = "";
63+
const char* test_host = "localhost";
6464
constexpr int num_msgs = 50;
6565

6666

0 commit comments

Comments
 (0)