本文整理匯總了Golang中C.BIO類的典型用法代碼示例。如果您正苦於以下問題:Golang BIO類的具體用法?Golang BIO怎麽用?Golang BIO使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
在下文中一共展示了BIO類的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: cbioNew
//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
}
示例2: go_conn_bio_new
//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)
}
示例3: go_conn_bio_free
//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)
}
示例4: Disconnect
func (self *writeBio) Disconnect(b *C.BIO) {
if loadWritePtr(b) == self {
b.ptr = nil
}
}
示例5: bioSetRetryRead
func bioSetRetryRead(b *C.BIO) {
// from BIO_set_retry_read and BIO_set_flags
b.flags |= (C.BIO_FLAGS_READ | C.BIO_FLAGS_SHOULD_RETRY)
}
示例6: bioClearRetryFlags
func bioClearRetryFlags(b *C.BIO) {
// from BIO_clear_retry_flags and BIO_clear_flags
b.flags &= ^(C.BIO_FLAGS_RWS | C.BIO_FLAGS_SHOULD_RETRY)
}
示例7: Disconnect
func (self *readBio) Disconnect(b *C.BIO) {
if loadReadPtr(b) == self {
b.ptr = nil
}
}
示例8: Disconnect
func (self *readBio) Disconnect(b *C.BIO) {
if loadReadPtr(b) == self {
readBioMapping.Del(token(b.ptr))
b.ptr = nil
}
}