Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I am slightly going mad. Even if I call socat like this:

socat -vvvv tcp4-listen:9000 tcp4-listen:9001

it works perfectly, but doesn't inform me about incoming TCP connections! Is there an additional verbosity option that makes socat show this information, something like

Connection from XYZ

Can't be such a special function, or can it?

share|improve this question
add comment

1 Answer

up vote 2 down vote accepted

By old habit I am just used to grouping arguments together like -dddd for more verbose debugging, but when I actually tried what the manpage said (-d -d) it worked just fine. For logging connections, just do:

socat -d -d tcp4-listen:9000 tcp4-listen:9001
share|improve this answer
    
ps; in your example the connection isn't "established" until something has connected to both port 9000 and 9001, so the output is printed upon both parties being connected. Just so you don't test only connections to one port and think it fails because it doesn't print anything. :P –  Mattias Ahnberg Jan 26 '12 at 19:25
    
In this case I am interested in connections to both sides separately (or in fact only the lefthand listen part). Thanks for your answer, I'll accept this if nobody can provide a better solution (no offense, but this doesn't quite serve my use case). –  Niklas B. Jan 26 '12 at 19:42
    
I gave it some more thought and came up with a very simple solution, so I replaced my old suggestion. If someone is interested they can look at the old edits. :P Hope this is good enough for your use case! –  Mattias Ahnberg Jan 27 '12 at 0:47
    
Thank you so much! –  Niklas B. Jan 27 '12 at 12:07
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.