问题描述:

I am working with the Epson TM-T82II-i printer which is a special type of printer that forwards requests onto other printers on the network.

What we are trying to do is impersonate a printer on our network, such that the TM-T82II-i sends requests to us and we can decode the request and store in the database.

To do this, we simply create a piece of software which listens on a particular IP address and port. We then register that IP address as a printer in the TM-T82II-i settings page.

When we press the Test print button, I can see that the TM-T82II-i is indeed routing requests to this IP address. Unfortunately, it appears that the PORT number varies and I believe this is why I'm unable to receive the request in my software. I have observed this behaviour regardless of which printer model I try to impersonate in the TM-T82II-i.

Screenshot of network capture

I have two questions:

  • is it even possible that the destination printers could be listening on all port numbers? I always thought in networking that you could only listen to one port at once, so I'm not sure why the TM-T82II-i seems to think it can send its requests over any arbitrary port number.
  • if it is possible above, can somebody advise how I can write a TcpListener (in C#) that could listen to all incoming requests from a specific IP address (ie. from the TM-T82II-i printer), regardless of port?

Cheers,

相关阅读:
Top