- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
I have modified Simple Socket Server example for my application where my processor is a client. In this I am required to send and recv simultaneously. So in the beginning in CreateSocketTask, I create a socket and connect it to the server (After succesful connect, this task deletes itself). I have then two independent tasks: SendTask and RecvTask. In SendTask I periodically read data from a FIFO peripheral, format the data and send it. And In RecvTask, I can receive messages from the server. SendTask has higher priority then RecvTask. These two tasks are suspended before 'connect' and resume after 'connect' call. I observed while SendTask executes properly, RecvTask is not executing at all. However, if I keep RecvTask at higher priority, it is only the RecvTask which executes and the SendTask appears redundant. What could be the problem? Sincerely,Link Copied
1 Reply
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
In order for a lower priority task to get CPU time the higher priority task must have a OS Pend (OSFlagPend, OSMBoxPend etc...) or OSTimeDly() somewhere. Maybe the recv() and send() functions are non blocking and therefore do not suspend the task.
I think you could use the select() function, which is blocking and uses the OS calls.
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page