Ticket #7 (closed enhancement: fixed)

Opened 8 years ago

Last modified 8 years ago

Allow creating a Network.TCP.Connection from a pre-exisiting Socket

Reported by: joshhoyt@… Owned by: somebody
Priority: minor Milestone:
Component: component1 Version:
Keywords: Cc:


I already have a Socket object that I want to perform HTTP operations on. I want to use ByteStrings?, so I can't use the Stream instance for Socket from Network.Stream. I want to use Connection from Network.TCP, but the external API only allows connecting to a given host/port, not creating from an existing Socket. The attached patch exports a function that creates a Connection from a Socket.


Change History

Changed 8 years ago by joshhoyt@…

Changed 8 years ago by joshhoyt@…

Oops. That patch just creates a HandleStream? and not a connection (which is sufficient, but means that the function is incorrectly named)

Changed 8 years ago by sof

  • status changed from new to closed
  • resolution set to fixed

Good suggestion and contribution; incorporated and added. Available as an overloaded operation on HStreams, openSocketStream

Changed 8 years ago by sof

Forgot to say...included in HTTP-4000.0.7 which has now been uploaded to Hackage.

Note: See TracTickets for help on using tickets.