Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: TCP Socket and Serial Port

by zwon (Monsignor)
on Jan 09, 2012 at 15:11 UTC ( #947017=note: print w/ replies, xml ) Need Help??


in reply to TCP Socket and Serial Port

Your description of the problem is not especially clear for me, but I see that you're accessing single serial port from multiple threads without any synchronization, so I'm not surprised you have a problem. Only one client may write into serial port at a time, so I'd recommend you rewrite this script without threads, it would be much less code to debug then. Also, if you would add error checks after IO operations, it could help to find the problem too. E.g. instead of:

print $lclient "$lpeer -> Welcome\n\r"; # it will never be sended!
you can write
print $lclient "$lpeer -> Welcome\n\r" or die "Send failed because: $! +";


Comment on Re: TCP Socket and Serial Port
Select or Download Code
Re^2: TCP Socket and Serial Port
by FlyingEagle (Initiate) on Jan 10, 2012 at 00:11 UTC
    ok, but this is not my biggest problem at this time. my problem is the error by using lookfor ... did u mean with "synchronizing" that i've to use 2 booleans to lock each write and lookfor? regards

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://947017]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (8)
As of 2014-08-28 09:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (259 votes), past polls