I just started to port code from Windows OS to Solaris. I need a way to implement something similar to AIO with Completion Port from Windows on Solaris OS. After initial investigation I have discovered port - events API.
It is quite elegant.
The problem is that I can't figure out if it is possible to use single port to achieve full duplex socketing.
This means is it possible to serve both POLLIN & POLLOUT for given socket ( PORT_SOURCE_FD ) with single port ?
From port_associate man pages it seems that it is not possible to achieve something like that.
"... If the specified object is already
associated with the specified port, the port_associate()
function serves to update the events and user arguments of
the association. ..."
Does this means that I need to create two separate ports - one for POLLIN events and the other for POLLOUT events in order to be able to achieve full duplex concurrent socket ?
Since I'm quite new in Solaris development I would kindly ask you to give me a hint what would be the best way to implement something similar to Windows Asynchronous IO With Completion Port on Solaris OS.
Yes, it can't use single port to achieve full duplex socketing, under win32, there have some tools, for example [serial port splitter|http://www.softsea.com/review/Serial-Port-Splitter.html], can allow you to share one serial port among several applications, but Slaris can't support this, and the funcation port_associate() need use two separate ports.