WIP Tcp client must be run from task 0?

Hi,

I’m having troubles with my TCP client. As I understood the bearer must be run from task 0, other WIP functionality like Tcp client or server can be run from an other task. The problem is that when I create a tcp socket connection with my server from an other task then task 0, I can’t send or receive any data. When I read out the state of the WIP (wip_getState) the state is always WIP_CSTATE_BUSY.
When I place all the functions in task 0 everything is working fine.

Could somebody explain this to me?

thanks

So do that, then! 8)

Do you suspend the task with the TCP ?

See your other thread: Can't receive message in other task then task 0
Suspending a task means (apparently) that it can’t receive any of the “normal” ADL “events” - I’d be pretty certain that WIP relies upon such “events”…

Seriously, as this whole thing is so poorly documented, I’d recommend just keeping all the WIP stuff in Task 0 - why risk any other “Gotchas!” … ?! :unamused:

I tought it would be nicer to do all the internet communication in a seperate task. I wanted to fix the problem, not avoid it :slight_smile:
Anyway, I wasn’t suspending the task. What I did is sending a message from the main to an other task. In the message receive I started the communication. I couldn’t find or there is a maximum running time for the message callback so I supposed that it wouldn’t be a problem, but it seems that it is.
I placed all functions now in task 0. I’m wondering why SiWi made a ‘multi-task’ system…

Yes - I also wonder that… :confused:

Maybe I’m just seriously missing something about the way it’s supposed to work…

You weren’t doing a wait (busy-loop) in the message handler - were you?

No, the only thing I did in the message handler was calling the wip_TCPClientCreate function. The strange thing is that I get a new connection on the server, but the event handler would never be called.