Is there a way to change the number of output ports in a component at run-time? - redhawksdr

In my application I will not know the number of output ports for the component until a user specifies a configuration file. I attempted to do this by leaving the number of output ports in the .scd.xml file at zero. When I select the configuration file through the IDE on the property change event I call releaseOutPorts() and delete any existing port objects.
In my example component I create N new output ports by creating new bulkio::OutFloatPort objects, and activate them in the same way the custom ports are activated in the USRP_UHD component by calling ossie::corba::RootPOA()->activate_object(port)
and calling registerOutPort. I receive no errors when I do this but I cannot see the ports show up in either the sandbox or the IDE. Is it a problem because no port information is supplied in the .scd.xml file? Can anyone shed some insight into how the ports are currently enumerated when a component is dragged into the chalkboard or loaded into the sandbox?

You are correct; the IDE uses the the scd.xml file to display the ports. There isn't a way to programmatically obtain a list of all ports.

Related

Does'nt Liferay work at different ports?

I have developed a portal page using Liferay and the port number is 8080. I wanted to test SSO, I decided not to try with the existing one as there might be some problems and I might end up crashing the whole thing. As a result I downloaded a new liferay portal. Iadded it to the eclipse and ran the second server whose port number was changed to 8085. But the webpage displayed when the second server ran was still 8080 and the same page as the first portal. Later I downloaded the enterprise edition and did the same, still 8080: 1st portal. I changed the plugins, no progress. Later, I changed the port number of first one to 8090. The page was not being displayed at all. Why is it like this? I don't get it. Does liferay work with a single port or can't there be two Liferay portal at a time?
You can always navigate to exactly the port that you configure - given that the appserver actually serves connections to the port. Common mistakes that I see (assuming you're running tomcat):
People change server.xml to refer 8080 to 8090, but leave the other ports (8005 and 8009) untouched. This means that there are conflicts with two tomcats. If you run both tomcats at the same time, the second one will not start, because another program is already listening to 8005 and/or 8009). You'll need to change all ports to unique values (search server.xml for all declarations of port=
You're relying on the browser to automatically open. Liferay's portal-ext.properties allows to override the page to automatically open - either to being empty or to a specific other URL. Configure browser.launcher.url to your requirements (see below)
There might be other servers running on either port that you're trying to have tomcat - or any other appserver - listening on.
(Here's the default for browser.launcher.url)
# Enter a URL to automatically launch a browser to that URL when the portal
# has fully initialized. Enter a blank URL to disable this feature.
#
browser.launcher.url=http://localhost:8080

How do I use puppet to configure network settings?

I have written a module that will configure network settings on my system but I can't apply the manifest because before a manifest is applied it does "facter ipaddress" to find and present global facts.
Does it mean that in order to apply puppet manifest we must have IP configured ?
So I have a system that has no IP address configured and i want to use puppet to configure that IP address for me, for that I am asking user to input IP address which i save in a .csv file, then I am using a template to configure if-eth0 file. Template will do extlookup to fill up the fields in template and template is finally called upon inside a manifest. So the problem is that before anything is applied by puppet, it fails to run with following error
facter ip address unable to resolve IP , reason anonymous
I am not sure about the actual question (if IP is indeed needed). However, if I understand correctly you can try one of the two workarounds:
Enable DHCP
This way when your system boots will take a little bit more time (assuming there is no DHCP service on the network). A timeout will occur which, in most of the cases, results in a default IP (169.254.Y.Z if I remember). In this case you may need to stop/kill the dhcp client process before applying static IP or restart the interface to get the new configuration.
Assign default static IP
If you know that puppet configuration will be applied no matter what (maybe a call in rc.local?), you can configure your interface with a static IP (ie 10.1.1.10) to avoid the error message. This is temporary since once puppet runs, the correct configuration will be applied.
Hope it helps,
Andreas

How do you connect REDHAWK devices on different machines?

I am trying to run a waveform with components operating on distinct machines. That is, I want A->B where component A runs on the GPP on machine 1 and component B runs on the GPP on machine 2. The CORBA nameserver on system A is visible in REDHAWK on system B, but I cannot access remote devices or components when I run a waveform.
How can I make the devices on one machine available to REDHAWK running on another?
Thanx for your assistance!
-jerhill
The essential thing for spreading REDHAWK components and devices across multiple machines is making sure that your CORBA communication works correctly between the machines. This usually amounts to configuring /etc/omniORB.cfg correctly. First, on one machine, you should have omniNames and omniEvents running, and setup your config per section 2.6 of the documentation. For reference:
InitRef = NameService=corbaname::127.0.0.1
InitRef = EventService=corbaloc::127.0.0.1:11169/omniEvents
On the second machine, your InitRef's must point to the first machine. If the first machine was 192.168.1.100, then your second machine's config could contain:
InitRef = NameService=corbaname::192.168.1.100
InitRef = EventService=corbaloc::192.168.1.100:11169/omniEvents
You should be able to verify this is working correctly on the second machine with:
$ nameclt list
The next issue you need to tackle is making sure that CORBA objects are listening on the appropriate network interfaces, and are publishing information in their IORs that allows them to be reached. In each of your config files, I recommend you add a line to tell omniORB what endpoint CORBA objects created on that machine should listen on. For example, on your first machine:
endPoint = giop:tcp:192.168.1.100:
endPoint = giop:unix:
This tells omniORB that CORBA objects should listen on a TCP port of their choosing on 192.168.1.100. It also adds a Unix pipe for fast access by objects on the same machine. omniORB will publish this information in the IOR for that object. What you choose here is important - if you use an IP that other machines can't reach, or use a hostname that other machines can't resolve then CORBA connections will fail.
After you've configured the endPoint setting on both machines, you may find it useful to inspect the information contained in your IORs. If you can access the naming service then you can retrieve IORs for your objects. For example, if you had a domain named 'REDHAWK_DEV' running, you can get the domain manager's IOR via:
$ nameclt resolve REDHAWK_DEV/REDHAWK_DEV
Then, feed the IOR to catior:
$ catior IOR:012345...
catior will decypher the IOR for you and show you what address and port a client would connect to.
Based on the fact that programs on B can see the name service on A, then I assume that the problem relates to Device/Device Manager configuration.
Make sure that the Device Manager on B meets these criteria:
the id attribute of the deviceconfiguration element of the dcd.xml file is unique
the id attribute of the GPP's componentinstantiation element on the dcd.xml file is unique
the name attribute of the namingservice element on the dcd.xml file is the Domain you are trying to connect to (of the form DomainName/DomainName)
you do not have a Domain Manager running on B that has a colliding name with the Domain Manager on A (an error should occur if you do that)
If these criteria are met and your system still does not work, please post the stdout from running nodeBooter from command-line for both the Device Manager that's not registering and the Domain Manager you're trying to register with.

GPE for Juno overwrites arguments in run config

I'm using GPE (GWT 2.5 plugin) on Eclipse Juno and it looks like the content of the arguments tab gets overwritten each time I perform the apply button. Only workaround is to edit the arguments tab last and then close the dialog. I have to set a different port number, but the port attribute gets deleted as mentioned above. I don't use embedded server.
TIA
ujbi
What port number are you setting? If you're setting it to the default port number expected for that server, it will be removed from the Arguments tab.
Have you tried changing the port number in the Launch Config UI? There should be a tab for "Server", where you can change the port.
#Rajeev
I dont't use the default port (8888) and I dont' want to use the embedded server, so this is not checked in the 'server' tab. The application is running on a JBoss Server on port 8080.
When I add this via '-port 8080' in the 'Arguments' tab it will be romved mostly.

How to select a static port number for a custom app?

We've got a custom application that needs to serve requests on it's own port number. We really don't care what the number is, although we'll stick to that port after we decide. How do I select a number which is least likely to conflict with other applications or services that are running on the user's system?
Are there any rules or standards we should follow?
A clarification: once we pick a port, we need to stick with it. Can't use a dynamic one. We're building a custom SFTP server and we'll have to tell our customers what port it's running on.
For a static application, consider checking /etc/services to find a port that will not collide with anything else you are using and isn't in common use elsewhere.
$ tail /etc/services
nimspooler 48001/udp # Nimbus Spooler
nimhub 48002/tcp # Nimbus Hub
nimhub 48002/udp # Nimbus Hub
nimgtw 48003/tcp # Nimbus Gateway
nimgtw 48003/udp # Nimbus Gateway
com-bardac-dw 48556/tcp # com-bardac-dw
com-bardac-dw 48556/udp # com-bardac-dw
iqobject 48619/tcp # iqobject
iqobject 48619/udp # iqobject
If you can't predict the exact kind of environment your application is going to run, just don't bother with this. Pick any number over 1024 and also make it configurable so the user can change it in case of conflict with another service/application.
Of course you can still avoid very common ports like 8080 (alternative HTTP) or 3128 (proxies like squid), 1666 (perforce), etc. You can check a comprehensive list of known ports here, or take a look at /etc/services.
If you don't care about the port number, and don't mind that it changes every time your program is run, simply don't bind the port before you listen on it (or bind with port 0, if you want to bind a specific IP address). In both cases, you're telling the OS to pick a free port for you.
After you begin listening, use getsockname to find out which port was picked. You can write it to a file, display on it on the screen, have a child inherit it via fork, etc.
If you want a unique port number for your application, you need to request an assignment from IANA, who maintain the Service Name and Transport Protocol Port Number Registry for the IETF. /etc/services and other secondary records are populated from the IANA registry.
Please do not simply pick a number and ship your application (as mentioned in another answer), because sooner or later, IANA will assign the port you're squatting on to an incoming request, which can lead to conflicts for your application and the unaware assignee.

Resources