Commit 90006e7b authored by Ivan Krasin's avatar Ivan Krasin

Loop is now just listening, there's writer, errorHandler goroutines and a...

Loop is now just listening, there's writer, errorHandler goroutines and a handler goroutine per request
parent 3bc0e857
...@@ -146,6 +146,9 @@ func recvmsg(fd int, msg *syscall.Msghdr, flags int) (n int, errno int) { ...@@ -146,6 +146,9 @@ func recvmsg(fd int, msg *syscall.Msghdr, flags int) (n int, errno int) {
func Recvmsg(fd int, msg *syscall.Msghdr, flags int) (n int, err os.Error) { func Recvmsg(fd int, msg *syscall.Msghdr, flags int) (n int, err os.Error) {
n, errno := recvmsg(fd, msg, flags) n, errno := recvmsg(fd, msg, flags)
if n == 0 && errno == 0 {
return 0, os.EOF
}
if errno != 0 { if errno != 0 {
err = os.NewSyscallError("recvmsg", errno) err = os.NewSyscallError("recvmsg", errno)
} }
...@@ -172,6 +175,7 @@ func Writev(fd int, packet [][]byte) (n int, err os.Error) { ...@@ -172,6 +175,7 @@ func Writev(fd int, packet [][]byte) (n int, err os.Error) {
iovecs[i].Len = uint64(len(packet[i])) iovecs[i].Len = uint64(len(packet[i]))
} }
n, errno := writev(fd, (*syscall.Iovec)(unsafe.Pointer(&iovecs[0])), len(iovecs)) n, errno := writev(fd, (*syscall.Iovec)(unsafe.Pointer(&iovecs[0])), len(iovecs))
if errno != 0 { if errno != 0 {
err = os.NewSyscallError("writev", errno) err = os.NewSyscallError("writev", errno)
return return
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment