On Fri, 12 Jun 2015 16:57:08 GMT, Charles wrote:

On Fri, 12 Jun 2015 13:24:17 GMT, Kelet wrote:

I cannot use anything like a ConnectionPool as I'm confined to a singular connection.

I'm curious as to why that's a requirement...

What you're trying to do is put a hose in a pipe, fill it up with water from one side. At the same time, you already have a hose filling it up with water on the other side. If you could actually manage this you'd never be able to figure out where the water came from. Water is water.

In order to get around this, you need to do one of two things:

  1. Clear the pipe prior to sending stuff the other direction.
  2. Get a new pipe dedicated to moving in the other direction.

Option 2 isn't an option for you based on what you've said. Clearly this issue isn't specific to Vibe.d, but to the problem itself.

That means you need to have one connection and switch it. Fortunately, you could keep your current model with multiple fibers, and create a manager to figure out if you have data to send or data to receive, and then hand-off the connection appropriately.

Hi Charles,

Thanks for the response.

I'm working with a remote host that I don't have any control over. If I have an active connection, and I connect again, the original connection is terminated. That's just how the remote host works.

As to your pipe analogy: I'm not very keen on network communications but are sockets not typically full duplex?

Thanks,
Kelet