Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

net: ResolveTCPAddr cannot parse literal tcp endpoint on non-tcp network #8981

gopherbot opened this issue Oct 22, 2014 · 2 comments


None yet
2 participants
Copy link

commented Oct 22, 2014

by mathias.dietrich:

go version go1.3.3 darwin/amd64

/* DaytimeServer
package main

import (

func main() {

    service := ":1200"
    tcpAddr, err := net.ResolveTCPAddr("ip4", service)

    listener, err := net.ListenTCP("tcp", tcpAddr)

    for {
        conn, err := listener.Accept()
        if err != nil {

        daytime := time.Now().String()
        conn.Write([]byte(daytime)) // don't care about return value
        conn.Close()                // we're finished with this client

func checkError(err error) {
    if err != nil {
        fmt.Fprintf(os.Stderr, "Fatal error: %s", err.Error())

This comment has been minimized.

Copy link

commented Oct 22, 2014

Comment 1 by mathias.dietrich:

tcpAddr, err := net.ResolveTCPAddr("ip4", service)  
should be:
tcpAddr, err := net.ResolveTCPAddr("tcp4", service)
not an go issue, please close CR

This comment has been minimized.

Copy link

commented Oct 22, 2014

Comment 2:

Status changed to Retracted.

@gopherbot gopherbot added the retracted label Oct 22, 2014

@golang golang locked and limited conversation to collaborators Jun 25, 2016

This issue was closed.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.