python sockets question

E

Eric Miller

Can python sockets be used to capture IP traffic when the traffic is originating from a non-python source?

Using a Lantronix UDS-1100 serial to IP converter. The goal is to write a small proof of concept piece in Python to capture serial data output by thisdevice over IP.

I've done a couple test projects using sockets in python, but they were alldone between python processes (python > python): listen() on one end, and connect(), sendall() etc on the other.

I think I can use sockets for this project, but before I invest a bunch of time into it, wanted to make sure it is a viable solution.

Can python sockets be used to capture IP traffic when the traffic is originating from a non-python source? I have full control over the IP and port that the device sends the serial data to, but there will be no python connect() initiated by the client. I can pre-pend then serial data with some connect() string if needed.

If sockets won't work, please recommend another solution...guessing it willbe REST or similar.
 
A

Andrew Berg

Can python sockets be used to capture IP traffic when the traffic is originating from a non-python source?
Python just exposes the underlying OS socket interface. There is nothing special about sockets in Python. The whole point is to connect
heterogeneous systems. I can use Python on Windows to create a client that will connect to a service written in C running on Solaris or to
something written in Java running on Linux.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,962
Messages
2,570,134
Members
46,692
Latest member
JenniferTi

Latest Threads

Top