Ticket #2784 (closed bug: invalid)

Opened 5 years ago

Last modified 4 years ago

Cannot call connect with a socket that is already bound.

Reported by: felixmar Owned by:
Priority: normal Milestone: Not GHC
Component: libraries/network Version: 6.10.1
Keywords: Cc:
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: Difficulty: Unknown
Test Case: Blocked By:
Blocking: Related Tickets:

Description

> import Network.Socket
> sock <- socket AF_INET Datagram 0
Loading package parsec-2.1.0.1 ... linking ... done.
Loading package network-2.2.0.1 ... linking ... done.
> bindSocket sock (SockAddrInet aNY_PORT iNADDR_ANY)
> connect sock undefined
*** Exception: user error (connect: can't peform connect on socket in status Bound)

Network.Socket.connect checks the SocketStatus of the socket:

if currentStatus /= NotConnected

From  The Open Group Base Specifications Issue 6: "If the socket has not already been bound to a local address, connect() shall bind it to an address which, unless the socket's address family is AF_UNIX, is an unused local address."

Change History

Changed 4 years ago by igloo

  • difficulty set to Unknown
  • milestone set to Not GHC

Changed 4 years ago by igloo

  • status changed from new to closed
  • resolution set to invalid
Note: See TracTickets for help on using tickets.