The broadcast_timeout (optional) parameter default : 500 specifies how much time in milliseconds the UDP broadcast messages should wait for replies.min_port and max_port must be within the port range 0-65535.min_port and max_port are included in the port range.This method does exactly the steps detailed in the General Information section.Methods scan(min_port, max_port, broadcast_timeout = 500, fallback = true, icmp_timeout = 50, packet_timeout = 500) Starts the scan for the hosts that have services in the min_port-max_port port range You need to bind your listeners to the proper events first depending on your logic, then call the API methods. Usage import from 'react-native-lanscan' Īll the found hosts are returned via event emitter. Then in the same file add the import statement :.In your app's MainActivity.java file, add new LANScanReactModule() to the return statement of the getPackages() function. Open your app's adle file and add the following line to the dependencies block. Project(':react-native-lanscan').projectDir = new File(settingsDir, './node_modules/react-native-lanscan/android')Ĭhange the include line of your project's adle to include the :react-native-lanscan project. Once the services are found, you can then initialize a socket connection to those services using the awesome react-native-udp package or its fork the react-native-tcp package by Andy Prock depending on your needs.Īdd the following line to the bottom of your project's adle file.Keeps sending datagram UDP packets to each connected host on the same port range and keeps waiting for replies.there isn't much we can do, is there ? □) (This only works if the switch is not blocking ICMP requests.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |