Linux不接受到25端口的连接。

huangapple go评论68阅读模式
英文:

Linux not accepting connections to port 25

问题

我正在处理一个简单的SMTP服务器,但是在接受端口25上的TCP连接方面遇到了问题。

我尝试从本地主机上运行服务器,并使用telnet进行连接,它可以正常工作。但是从另一台计算机上尝试连接时,它显示正在尝试连接到(ip)...

当我从Gmail发送电子邮件到我的SMTP服务器时,它无法建立连接。

以下是相关的Golang代码:

func main() {
    listener, err := net.Listen("tcp", ":25")
    checkError(err)
    for {
        conn, err := listener.Accept()
        checkError(err)
        go handleConnection(conn)
    }
}

这是在Digital Ocean上运行的Ubuntu服务器。

我知道端口25没有被占用,并且我还有剩余的文件描述符。

英文:

I am working on a simple smtp server, but am stuck on accepting TCP connections on port 25.

I tried running to server and using telnet from localhost and it works. From a separate computer it says trying (ip)...

When sending email's from GMail to my smtp server it does not see any connection

relevant code in Golang

func main() {
    listener, err := net.Listen("tcp", ":25")
    checkError(err)
    for {
        conn, err := listener.Accept()
        checkError(err)
        go handleConnection(conn)
    }
}

It is a Ubuntu server running on Digital Ocean

I know port 25 is not being used and I have file descriptors remaining

答案1

得分: 1

尝试在不同的端口上运行,它成功了。看起来是一个 Digital Ocean 的问题。

英文:

Tried it on a different port and it worked. Seems to be a Digital Ocean thing.

huangapple
  • 本文由 发表于 2014年10月19日 08:24:30
  • 转载请务必保留本文链接:https://go.coder-hub.com/26445966.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定