Navigation Menu

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: add examples #5757

Closed
adg opened this issue Jun 23, 2013 · 17 comments
Closed

net: add examples #5757

adg opened this issue Jun 23, 2013 · 17 comments
Labels
Documentation FrozenDueToAge help wanted Suggested Issues that may be good for new contributors looking for work to do.
Milestone

Comments

@adg
Copy link
Contributor

adg commented Jun 23, 2013

The net package is somewhat overwhelming. Good examples would help.
@rsc
Copy link
Contributor

rsc commented Jul 30, 2013

Comment 1:

Labels changed: added go1.2.

@rsc
Copy link
Contributor

rsc commented Sep 10, 2013

Comment 2:

Labels changed: added documentation.

@rsc
Copy link
Contributor

rsc commented Sep 11, 2013

Comment 3:

Labels changed: added go1.2maybe, removed go1.2.

@rsc
Copy link
Contributor

rsc commented Oct 2, 2013

Comment 4:

Labels changed: added go1.3, removed go1.2maybe.

@gopherbot
Copy link

Comment 5 by imjasonh:

What kinds of samples are you looking for? I'd be happy to contribute some simple ones
if there are requests for anything in particular.

@rsc
Copy link
Contributor

rsc commented Dec 4, 2013

Comment 6:

Labels changed: added release-go1.3.

@rsc
Copy link
Contributor

rsc commented Dec 4, 2013

Comment 7:

Labels changed: removed go1.3.

@rsc
Copy link
Contributor

rsc commented Dec 4, 2013

Comment 8:

Labels changed: added repo-main.

@rsc
Copy link
Contributor

rsc commented Apr 3, 2014

Comment 9:

Labels changed: removed release-go1.3.

@rsc
Copy link
Contributor

rsc commented Apr 3, 2014

Comment 10:

Labels changed: added release-none.

@adg adg added accepted Suggested Issues that may be good for new contributors looking for work to do. Documentation labels Apr 3, 2014
@rsc rsc added this to the Unplanned milestone Apr 10, 2015
@marcellanz
Copy link

what is the intention and scope of examples in the documentation? is it defined how examples complement the documentation?

@parkr
Copy link

parkr commented Nov 24, 2015

The net package is somewhat overwhelming. Good examples would help.

@adg Have a moment to answer @marcellanz's question? Thank you!

@bradfitz
Copy link
Contributor

@marcellanz, examples are documentation. Some people prefer to learn by reading code instead of reading words.

@kavirajk
Copy link
Contributor

net package have just one example https://golang.org/pkg/net/#example_Listener And even that fails with following error.

`
fatal error: all goroutines are asleep - deadlock!

goroutine 1 [semacquire]:
sync.runtime_notifyListWait(0x1054e080, 0x0)
/usr/local/go/src/runtime/sema.go:267 +0x1e0
sync.(_Cond).Wait(0x1054e078, 0x1054e070)
/usr/local/go/src/sync/cond.go:57 +0xe0
syscall.(_queue).waitRead(0x1054e070, 0x1, 0x0, 0x0, 0x105000f0, 0x0, 0x0, 0x0)
/usr/local/go/src/syscall/net_nacl.go:263 +0x180
syscall.(_msgq).read(0x1054e070, 0x1050e090, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0)
/usr/local/go/src/syscall/net_nacl.go:377 +0xc0
syscall.(_netFile).accept(0x10534100, 0x1c8da0, 0x10534100, 0x0, 0x0, 0x0, 0x0, 0x1050e0f8)
/usr/local/go/src/syscall/net_nacl.go:539 +0x60
syscall.Accept(0x3, 0x77d5, 0x10534140, 0x0, 0x0, 0x0, 0x0, 0x0)
/usr/local/go/src/syscall/net_nacl.go:759 +0xa0
net.accept(0x3, 0x170144, 0x10534140, 0x0, 0x0, 0x0, 0x0, 0x77d5)
/usr/local/go/src/net/sys_cloexec.go:45 +0x60
net.(_netFD).accept(0x10534140, 0x1, 0x0, 0x0, 0x0, 0x2)
/usr/local/go/src/net/fd_unix.go:411 +0x220
net.(_TCPListener).accept(0x1050a188, 0x1c02a0, 0x10529f28, 0x0, 0x0, 0x10529f28)
/usr/local/go/src/net/tcpsock_posix.go:132 +0x40
net.(*TCPListener).Accept(0x1050a188, 0x1c053c, 0x0, 0x0, 0x0, 0x0)
/usr/local/go/src/net/tcpsock.go:222 +0xc0
main.main()
/tmp/sandbox839529466/main.go:18 +0x1a0
`

I'm thinking covering some examples for net package. Can we use any ports in the examples? just wondering how it will work
//cc @adg

@gopherbot
Copy link

CL https://golang.org/cl/42912 mentions this issue.

robphoenix added a commit to robphoenix/go that referenced this issue May 8, 2017
Further examples to support the net package.

See issue golang#5757

Change-Id: I839fd97a468c8d9195e8f4a0ee886ba50ca3f382
gopherbot pushed a commit that referenced this issue May 9, 2017
Further examples to support the net package.

See issue #5757

Change-Id: I839fd97a468c8d9195e8f4a0ee886ba50ca3f382
Reviewed-on: https://go-review.googlesource.com/42912
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
@gopherbot
Copy link

CL https://golang.org/cl/43711 mentions this issue.

gopherbot pushed a commit that referenced this issue May 22, 2017
Further examples to support the net package.

Updates #5757

Change-Id: I9b65521d211f6c404b9103c1eaf22b0772eb242e
Reviewed-on: https://go-review.googlesource.com/43711
Reviewed-by: Mikio Hara <mikioh.mikioh@gmail.com>
@kennygrant
Copy link
Contributor

The package now has 8 examples, so perhaps this could be closed as fixed?

https://tip.golang.org/pkg/net/#pkg-examples

@golang golang locked and limited conversation to collaborators Jul 15, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Documentation FrozenDueToAge help wanted Suggested Issues that may be good for new contributors looking for work to do.
Projects
None yet
Development

No branches or pull requests

10 participants