check server.c, when called by c++ code, the result is always -1

Signed-off-by: you <ylcaa@foxmail.com>