Ticket #7 (closed enhancement: fixed)

Opened 6 years ago

Last modified 6 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:

Description

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.

Attachments

Change History

Changed 6 years ago by joshhoyt@…

Changed 6 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 6 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 6 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.