View network data

Nov 5, 2012 at 5:20pm

View network data

Hi – trying to access network data coming in to a program on my machine (OSX)

I know the port it receives the data on, but when i tell either ‘mxj net.rcv’ or ‘sadam.tcpReceiever’ to look at that port, i get:

‘can’t bind to port’

which i suspect is because the application on my mac is already using it.

any way to listen in on the network data coming in so my max patch can react to it?

thanks!

#65076
Nov 7, 2012 at 2:30pm

any ideas? thanks!!

#234637
Nov 7, 2012 at 4:16pm

Hi,

I gave a couple of days ago a very basic explanation of how ports etc. work in this thread: http://cycling74.com/forums/topic.php?id=42962 (just scroll down to approx. the middle of the thread). The thing is: you can’t have two different things listening on the same port. So, if there’s another software already using the port, you won’t be able to connect to the same port. You can still use tools like Wireshark to analyze the global network traffic and filter somehow the incoming messages, however, I don’t think that Wireshark had an option to forward specific data to a third-party application (although you never know).

If the other software supports changing the port, then you could also do the following (which might or might not work, depending on how the other software implements IP communication): you could do a proxy in Max, which would catch all incoming data on the specified port, and then forward the information to another port, which your other software could catch. However, this might be quite complex, if not impossible, to implement if your software is using bidirectional communication (I have a bidirectional client in my library called [sadam.tcpClient], but I still didn’t finish the implementation for a server).

Hope that helps,
Ádám

#234638
Nov 7, 2012 at 4:31pm

Aha – was afraid of that. Thanks for the info!

#234639
Nov 7, 2012 at 4:33pm

Hi,

Maybe this will help. I don’t know how your processing skills are but you can use carnivore (the first link) to capture traffic in processing and send that to max via osc (i don’t know if that will interfere with the capturing though > feedbackloop?). Carnivore makes use of jpcap (the second link > java) which makes use of libpcap/tcpdump (the third link > c/c++) so you can go as deep as you want.

Good luck,
FRid

http://r-s-g.org/carnivore/
http://netresearch.ics.uci.edu/kfujii/Jpcap/doc/

http://www.tcpdump.org/

#234640
Nov 7, 2012 at 4:36pm

Thanks FRid! i’ll give it a look!

#234641
Nov 7, 2012 at 5:32pm

Lucky you :)

This prints incoming network traffic to the maxwindow. you do need winpcap (if on win), oscp5 and procssing to make this work but it works.

– Pasted Max Patch, click to expand. –
#234642

You must be logged in to reply to this topic.