sctp包的最大为1280

At the application layer, you can think of DataChannel as sending and receiving over SCTP. In the PPID (Payload Protocol Identifier) field of the SCTP header, Datachannel sets value 0x51 for indicating that it’s sending UTF-8 data and 0x52 for binary data.

Yes, you are right. RTCDataChannel uses SCTP over DTLS and UDP. DTLS is used for security. However, SCTP has problems traversing most NAT/Firewall setups. Hence, to overcome that, SCTP is tunneled through UDP. So the overall overhead to send data would be overhead of:

SCTP + DTLS + UDP + IP

and that is:

28 bytes + 20-40 bytes + 8 bytes + 20 – 40 bytes

So, the overhead would be rougly about 120 bytes. The maximum size of the SCTP packet that a WebRTC client can send is 1280 bytes. So at max, you can send roughly 1160 bytes of data per SCTP packet.

编译安装gcc6.4.0

wget https://gmplib.org/download/gmp/gmp-6.1.2.tar.xz
tar xvf gmp-6.1.2.tar.xz 
cd gmp-6.1.2
./configure --prefix=/usr/local/gmp
make && make install

wget http://www.mpfr.org/mpfr-current/mpfr-3.1.6.tar.gz
tar xvf mpfr-3.1.6.tar.gz 
cd mpfr-3.1.6
./configure --prefix=/usr/local/mpfr --with-gmp=/usr/local/gmp
make && make install

wget ftp://ftp.gnu.org/gnu/mpc/mpc-1.0.3.tar.gz
tar xvf mpc-1.0.3.tar.gz 
cd mpc-1.0.3
./configure --prefix=/usr/local/mpc --with-gmp=/usr/local/gmp -with-mpfr=/usr/local/mpfr
make && make install

vi /etc/ld.so.conf
#增加以下三行
/usr/local/gmp/lib
/usr/local/mpfr/lib
/usr/local/mpc/lib
#
ldconfig -v

wget ftp://ftp.gnu.org/gnu/gcc/gcc-6.4.0/gcc-6.4.0.tar.gz
tar xvf gcc-6.4.0.tar.gz
./configure --enable-checking=release --enable-languages=c,c++ --disable-multilib --with-gmp=/usr/local/gmp --with-mpfr=/usr/local/mpfr --with-mpc=/usr/local/mpc
make -j2 # 这个过程比较慢, 大概要半个多小时
make install
# 改名 /usr/bin 下的 cpp, c++, gcc, g++, gcov 这些文件, 再执行 gcc --version 就能看到新的版本信息了

Apple相关离线下载

Apple相关的离线下载地址
https://developer.apple.com/downloads
虚拟机的苹果驱动,要解压把下面的iso文件提出来,直接安装。
http://softwareupdate.vmware.com/cds/vmw-desktop/fusion/8.5.8/5824040/packages/

springboot的启动脚本配置

springboot启动与停止的最基本的脚本配置

#!/bin/sh

path_current=`pwd`
path_script=$(cd "$(dirname "$0")"; pwd)
mode=$1

app_process=`ps -ef | grep "waypal-tracker-server.jar"| grep -v grep`

case "$mode" in
   'start')
        echo "it's ready to start op...."
        if test -n "$app_process"; then
                echo ""
                echo "$app_process"
                echo ""
        else
                cd $path_script   #进入脚本所在目录下,目的是使springboot的config目录生效。
                nohup java -jar $path_script/bin/waypal-tracker-server.jar logPath=$HOME/waypalers.cn/tracker/data > /dev/null 2>&1 &
                cd $path_current

        fi

        echo 'success to start.'
        ;;
   'stop')
        echo "it's ready to check process..."
        if test -n "$app_process"; then
                echo "had find app process informaton"
                echo $app_process | awk '{print ($2)}' | xargs kill -9
        fi
        echo 'success to kill.'
        ;;
    *)
        basename=`basename "$0"`
        echo "Usage: $basename  {start|stop}  [ server options ]"
        exit 1
        ;;
esac
exit 1

springboot的外部配置文件

springboot允许以下四种方式加载配置文件,其优先级如下:
http://docs.spring.io/spring-boot/docs/current-SNAPSHOT/reference/htmlsingle/#boot-features-external-config
spring boot允许你自定义一个application.properties文件,然后放在以下的地方,来重写spring boot的环境变量或者定义你自己环境变量

1.当前目录的 “/config”的子目录下
2.当前目录下
3.classpath根目录的“/config”包下
4.classpath的根目录下

springboot跳过测试

springboot的默认配置下,使用[mvn package]指令打包,会进行单元测试的检查,可以选择直接跳过单元测试。

mvn install -DskipTests
或
mvn install -Dmaven.test.skip=true