]> 127.0.0.1 Git - part/.git/commitdiff
33
authorqydysky <qydysky@foxmail.com>
Mon, 3 Aug 2020 10:11:52 +0000 (18:11 +0800)
committerqydysky <qydysky@foxmail.com>
Mon, 3 Aug 2020 10:11:52 +0000 (18:11 +0800)
Net.go [new file with mode: 0644]

diff --git a/Net.go b/Net.go
new file mode 100644 (file)
index 0000000..0e9b60d
--- /dev/null
+++ b/Net.go
@@ -0,0 +1,21 @@
+package part
+
+import (
+       "net"
+)
+
+type netl struct{}
+
+func Net() *netl{
+       return &netl{}
+}
+
+func (*netl) TestDial(network,address string) bool {
+    conn, err := net.Dial(network,address)
+    if err != nil {
+               Logf().E(err.Error())
+        return false
+    }
+    conn.Close()
+    return true
+}
\ No newline at end of file