Skip to content

Latest commit

 

History

History
109 lines (84 loc) · 2.07 KB

DEVGUIDE.adoc

File metadata and controls

109 lines (84 loc) · 2.07 KB

Development Guide

How to create a rpm?

1. Install the required software
yum install -y rpmdevtools rpmlint

2. Update 'release.spec'

Update the Version and Release as a larger version, update the Name if you want to change the rpm name.

Name:           ttcp
Version:        x.x
Release:        x
3. Run 'release.sh'
./release.sh

The above steps execute success will genertate ttcp-x.x-x.$ARCH.rpm under ~/rpmbuild/RPMS/$ARCH folder.

How to create a docker image?

1. Install the docker
# docker -v
Docker version 20.10.14, build a224086
2. Make sure rpm could build as expected, run 'build.sh'
./build.sh

The above steps execute success will build docker images cloudadc/ttcp:x.x-x.

Linux Sock Err codes

errno description note

32

Broken pipe

Sock stream be broken

98

Address already in use

bind() failed due to address already in use

99

Cannot assign requested address

bind() failed due to can not assign a port

104

Connection reset by peer

read or write IO err due to peer reset connection

110

Connection timed out

firewall drop packet

111

Connection refused

connect() failed due to incorrect port, or proxy/firewall rejection.

113

No route to host

connect() failed due to incorrect host

Socket Options

test/sock/checkops.c is a test fucntion to list all available socket options, the following are options set in linux:

O_BROADCAST: default = off
SO_DEBUG: default = off
SO_DONTROUTE: default = off
SO_ERROR: default = 0
SO_KEEPALIVE: default = off
SO_LINGER: default = l_onoff = 0, l_linger = 0
SO_OOBINLINE: default = off
SO_RCVBUF: default = 87380
SO_SNDBUF: default = 16384
SO_RCVLOWAT: default = 1
SO_SNDLOWAT: default = 1
SO_RCVTIMEO: default = 0 sec, 0 usec
SO_SNDTIMEO: default = 0 sec, 0 usec
SO_REUSEADDR: default = off
SO_REUSEPORT: default = off
SO_TYPE: default = 1
IP_TOS: default = 0
IP_TTL: default = 64
TCP_MAXSEG: default = 536
TCP_NODELAY: default = off