[ja] apply patch

This commit is contained in:
Shin Kojima
2013-12-25 02:53:57 +09:00
parent af339093d2
commit 69c00cb548

View File

@@ -261,20 +261,12 @@ Go言語ではnetパッケージの`DialTCP`関数によってTCP接続を一つ
read_len, err := conn.Read(request)
if err != nil {
if err != io.EOF { // ignore EOF since client might send nothing for the moment
fmt.Println(err)
break
}
neterr, ok := err.(net.Error)
if ok && neterr.Timeout() {
fmt.Println(neterr)
break
}
fmt.Println(err)
break
}
if read_len == 0 {
continue
break // connection already closed by client
} else if string(request) == "timestamp" {
daytime := strconv.FormatInt(time.Now().Unix(), 10)
conn.Write([]byte(daytime))