//export cbioNew func cbioNew(b *C.BIO) C.int { b.shutdown = 1 b.init = 1 b.num = -1 b.ptr = nil b.flags = 0 return 1 }
//export go_conn_bio_new func go_conn_bio_new(bio *C.BIO) C.int { //we are initializing here bio.init = C.int(1) //see mem_new() bio.num = C.int(-1) bio.ptr = nil bio.flags = C.BIO_FLAGS_READ | C.BIO_FLAGS_WRITE return C.int(1) }
//export go_conn_bio_free func go_conn_bio_free(bio *C.BIO) C.int { var conn *Conn = (*Conn)(bio.ptr) conn.conn.Close() if C.int(bio.shutdown) != 0 { bio.ptr = nil bio.flags = 0 bio.init = 0 } return C.int(1) }