Mark
Use Wireshark and then go to
Capture -> Options
Ensure the correct interface is selected in the drop down. Because you are capturing on the same machine you dont need "Capture packets in promiscuous mode" ( but I dont think it will harm you.
And in the field "Capture filter" enter "port 50000" then click "Start" and it will only capture stuff on the port.
You then will only capture the info you require. There are other tools to "follow this stream" and I think this will put the conversation(s) back into "proper text".
HTH Keith
Date: Wed, 30 Mar 2011 11:08:43 +0100 From: mark@quarella.co.uk To: main@lists.alug.org.uk Subject: [ALUG] TCP/IP logging
I have a simple application which connects to port 50000 on a Linux box, communicates, then disconnects.
I'd like to log the entire communication in each direction in an easy-to-read format so that I can see what is going on. The protocol is ASCII but with a few control chars thrown in (eg STX/ETX/ACK/etc, and I wouldn't like to rule out NULL chars ever appearing in the data).
I can easily run the server side at (say) port 50001 instead and have "something" listen on port 50000 and connect to port 50000 and pass the data back and forth between the two, logging it as it goes, although I don't know what to choose for "something".
Or I could look at Wireshark, which I've played with in the past but never in anger, and my general feeling is that unless I learn how to sort the trees from the wood then this is going to give me too much information and I'm going to spend more time sorting through it than I do resolving the issues in the protocol.
Or maybe there are better alternatives altogether!
[If it's relevant: the Linux server has no GUI but is a VirtualBox virtual machine on another Linux server that does have a GUI where I could run Wireshark. The device connecting to the server is not a PC and has no diagnostic capability built in.]
-- Mark Rogers // More Solutions Ltd (Peterborough Office) // 0844 251 1450 Registered in England (0456 0902) @ 13 Clarke Rd, Milton Keynes, MK1 1LG
main@lists.alug.org.uk http://www.alug.org.uk/ http://lists.alug.org.uk/mailman/listinfo/main Unsubscribe? See message headers or the web site above!