RejectedSoftware Forums

Sign up

Get current task

AFAIK, the callback of listenTCP is run in its own Task/fiber. How do I get the Task struct for this task so I at a later time can interrupt the task to kill the connection?

I tried starting a new task in the callback, but since the TCPConnection passed to the callback is owned by the callback task/fiber, I get the following error:

[3FF3B2D9:3FF670D9 CRITICAL] CoreTaskFiber was terminated unexpectedly: Trying to acquire a TCP connection that is currently owned.

I was not able to change the owner of the TCP connection either. How could I do that?

Re: Get current task

I tried starting a new task in the callback, but since the TCPConnection passed to the callback is owned by the callback task/fiber, I get the following error:

[3FF3B2D9:3FF670D9 CRITICAL] CoreTaskFiber was terminated unexpectedly: Trying to acquire a TCP connection that is currently owned.

I get that error when I do the first read on the TCPConnection in the new task/fiber.

Re: Get current task

On Sat, 29 Jun 2013 20:50:01 GMT, Øivind Loe wrote:

I tried starting a new task in the callback, but since the TCPConnection passed to the callback is owned by the callback task/fiber, I get the following error:

[3FF3B2D9:3FF670D9 CRITICAL] CoreTaskFiber was terminated unexpectedly: Trying to acquire a TCP connection that is currently owned.

I get that error when I do the first read on the TCPConnection in the new task/fiber.

Just found Task.getThis() case closed :)