networking - How to obtain the IP of a network printer from a list of printers through Java -
i have database contains list of ip addresses various printers. users choose printer print on, , way see workng out java application iterate through list of printers until finds 1 matching ip address. using printservice class, i've been able generate list of printservices following code:
docflavor flavor = new docflavor.input_stream("application/octet-stream"); printservice pservices[] = printservicelookup.lookupprintservices(flavor, null);
when debug , step through code, able locate printer. can identify based on name gave when installed drivers local pc. however, stated above, need find based on ip address. when put current value of pservices on watch, able see value of ip address in "port" variable. through quick searching, found there no public "getter" method "port" variable. there easier way of doing this, or there i'm missing?
Comments
Post a Comment