diff --git a/socket.go b/socket.go index e607d99..732318e 100644 --- a/socket.go +++ b/socket.go @@ -210,6 +210,10 @@ var _ net.Conn = (*VirtioSocketConnection)(nil) func newVirtioSocketConnection(ptr unsafe.Pointer) *VirtioSocketConnection { id := xid.New().String() vzVirtioSocketConnection := C.convertVZVirtioSocketConnection2Flat(ptr) + err := unix.SetNonblock(int(vzVirtioSocketConnection.fileDescriptor), true) + if err != nil { + fmt.Printf("set nonblock: %s\n", err.Error()) + } conn := &VirtioSocketConnection{ id: id, sourcePort: (uint32)(vzVirtioSocketConnection.sourcePort),