I am using GTK 2.0 to write a program to control two IO ports; ttyS0 and ttyUSB0. If i were to open two different copies of the same program then it's all fine, but i need to be able to control two ports from one interface and that seems to be the problem.
my code for connection is:
and i guess the problem is that it binds to the pid. But this means that threads will not work either as the pid will be the same. Perhaps fork()? but i have to say i do not have the faintest idea how to do it. Any help appreciated.
Last edited by zazzybob; 12-22-2005 at 08:38 PM..
Reason: code tags added
I can't see all of what you're doing (please use code tags) but are you creating two separate fd's for these ports?
Plus, threads receive signals, not just one of them. Your code is confusing me - try looking at Steven's Advanced Programming in the UNIX Envrionment section 12.8 deals with threads and signals.
I think this is what you're asking...:
One process with two threads - each one controlling a port?
One process with two threads - each one controlling a port?
thats exactly what I want. My priority is in the interface, one interface controling 2 ports but u get the picture.
i think my prob is in the above. I need to bind the process ID to the fd. So if i bind fd1 to the pid, followed by bind fd2 to pid, fd2 receives the signal but fd1 cant. And vice versa, only the latter receives the signal.
And yes i'm using two different fd's for each port. In fact everything that can be duplicated is duplicated - including reusable functions.
Different threads within a process can receive different signals? Then should i bind each fd to the thread and not the process?
p.s. I dont really use forums - only mailing lists, so sorry bout not using the quotes. Didnt really know bout those.
** forum admins: Before you come down on my like a wrath of something, I can get no decent answers so I have to come to these Gurus' court ***
I am by no means Unix expert. However, none of our unix admin (aix & hpux) can give me an answer that makes sense.
My Issue:
Assigned ports in 8601,... (7 Replies)
When the netstat -an command is run on current unix machine, it seems that there's an excessive amount of ports established (roughly 600). How can I tell what each of these ports are being used for? (1 Reply)
Hi,
If for example i try to start tomcat in a solaris server and get errors related to address already in use, how can I know if this port is really used for another process?
If someone can point any documentation it will be very helpfull.
Thanks! :rolleyes: (9 Replies)
Hi ,
I need one help... Is there any command on solaris 10 to free the ports.
For e.g I used netstat -na| grep 8080
it displays either it is listening or established..
i want to free the ports...
Anyone please help me on this...
Thanks,
Shanmuga (2 Replies)
Hello UNIX people...
This is my first foray into the UNIX world so go easy on me...
I have a client who has hired me to do some work on his windows stuff, BUT it just so happens his UNIX server started giving him problems...
He is running SCO Open Server 5.0.6
The TTY ports won't... (5 Replies)
Ok, I've been working in the IT field for about 3 years now and I never fully understood the concept of ip ports. I just started a new job that uses Solaris and today it kinda clicked in my head and I want to know if I'm right or wrong.
Does each ip address have multiple ports. because we... (4 Replies)
I know i can look in the /etc/services file to look at referenced port numbers, but is there a command that will list the current ports being used? (i.e. what is the application does not have an entry in the services files :confused: ) (2 Replies)