riocm_cmp
ret = riocm_cmp(ch, RIO_CM_CONNECTED) ? 0 : -1;
if (!riocm_cmp(ch, RIO_CM_LISTEN)) {
if (!riocm_cmp(ch, RIO_CM_CONNECTED)) {
if (!riocm_cmp(ch, RIO_CM_CONNECTED)) {
ret = riocm_cmp(ch, RIO_CM_CONNECTED) ? 0 : -ECONNRESET;