Skip to content

It is not possible to use a Conn in ForkExec or Dup or Dup2 #918

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

Closed
rminnich opened this issue Jul 13, 2010 · 3 comments
Closed

It is not possible to use a Conn in ForkExec or Dup or Dup2 #918

rminnich opened this issue Jul 13, 2010 · 3 comments

Comments

@rminnich
Copy link
Contributor

File is used in Dup* and ForkExec. Conn is used to create connections, either pipes, UDP
connections, TCP connections, and so on. There is a disconnect between these constructs.
It should be possible to substitute a Conn in many places where a File is used, e.g. in
Dup or ForkExec; it currently is not. I have suggested a simple patch in 1711047, but
this change is somewhat unsatisfying because the Pipe type has four fds; which one of
these should be used. 

Also, even should 1711047 be accepted, there is a further problem, detailed in the same
patch, with the use of shutdown(): even if the File for a Conn is available via Dup or
ForkExec, the shutdown will blow the underlying connection away. 

What steps will reproduce the problem?
1.Try to user a Conn with ForkExec or Dup or Dup2

I'm not sure the rest of these questions are relevant. It's a design issue not related
to any particular version of Go. 

What is the expected output?


What do you see instead?


What is your $GOOS?  $GOARCH?


Which revision are you using?  (hg identify)


Please provide any additional information below.
@adg
Copy link
Contributor

adg commented Jul 21, 2010

Comment 1:

Labels changed: added priority-low, packagechange, removed priority-medium.

Owner changed to [email protected].

Status changed to Thinking.

@rsc
Copy link
Contributor

rsc commented Oct 1, 2010

Comment 2:

Issue #1154 has been merged into this issue.

@rsc
Copy link
Contributor

rsc commented Nov 5, 2010

Comment 3:

This issue was closed by revision a144e3e.

Status changed to Fixed.

@golang golang locked and limited conversation to collaborators Jun 24, 2016
@rsc rsc removed their assignment Jun 22, 2022
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants