Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Titan » Writing test port, incoming_message
Writing test port, incoming_message [message #1775844] Tue, 07 November 2017 07:57 Go to next message
Naum Spaseski is currently offline Naum SpaseskiFriend
Messages: 81
Registered: February 2016
Location: Sophia Antipolis
Member

Hello everyone,

I was searching this in the docs, but I didn't find anything: What is the recommended way to listen for a message in the test port, by using a separate thread/process or directly inside the port? Is it ok to start for listening in the user_map() - but then, how to manage the timeouts (when to restart the listening after timeout)?

And, what events are the write and read events in the test port?

Thanks in advance,

Best regards,
Naum
Re: Writing test port, incoming_message [message #1775846 is a reply to message #1775844] Tue, 07 November 2017 08:08 Go to previous messageGo to next message
Gábor Szalai is currently offline Gábor SzalaiFriend
Messages: 26
Registered: December 2015
Junior Member
Hi,

The Titan is designed to 1 thread per component, so no separate threads or process is needed.

There are 3 event handler functions in every test port, (or one which combines the 3) which are called when the socket either
- is readable: there are data available to read from the socket
- is writable: data can be written to the socket
- socket error: there is an error indication on the socket.

The meaning of the are the same as like the select()/poll() system call.

When you create the socket, you should register the socket for the appropriate event handler. Usually only the readable event is registered.

For a simple example please check the UDP test port.
Re: Writing test port, incoming_message [message #1775847 is a reply to message #1775846] Tue, 07 November 2017 08:23 Go to previous messageGo to next message
Naum Spaseski is currently offline Naum SpaseskiFriend
Messages: 81
Registered: February 2016
Location: Sophia Antipolis
Member

Hello Gabor,

Thanks for the explanation.

[ content deleted ]

Best regards,
Naum

[Updated on: Tue, 07 November 2017 08:25]

Report message to a moderator

Re: Writing test port, incoming_message [message #1775886 is a reply to message #1775847] Tue, 07 November 2017 15:58 Go to previous messageGo to next message
Naum Spaseski is currently offline Naum SpaseskiFriend
Messages: 81
Registered: February 2016
Location: Sophia Antipolis
Member

Sorry to bother,

One quick question: is it OK to use Handler_add_Fd() instead of Install_handler()? Which one is the recommended?

Best regards,
Naum
Re: Writing test port, incoming_message [message #1775912 is a reply to message #1775886] Wed, 08 November 2017 08:38 Go to previous message
Gábor Szalai is currently offline Gábor SzalaiFriend
Messages: 26
Registered: December 2015
Junior Member
The Handler_add_Fd() is the recommended function.
Previous Topic:Translation ports vs dual-faced ports part1
Next Topic:CYGWIN x64 version for GCC 6.4.0
Goto Forum:
  


Current Time: Mon Sep 24 17:07:05 GMT 2018

Powered by FUDForum. Page generated in 0.01453 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top