Skip to content

Commit

Permalink
Merge pull request #23 from aoxn/aoxn.master
Browse files Browse the repository at this point in the history
set socket to none block mode
  • Loading branch information
Code-Hex authored Apr 6, 2022
2 parents 71d0477 + c215416 commit a2ebc85
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions socket.go
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down

0 comments on commit a2ebc85

Please sign in to comment.