router

Find the MAC address of all devices connected to the same Wifi network

烂漫一生 提交于 2019-12-06 01:55:54
I'm trying to build a software that checks what devices are connected to my home network and return a list of those device's MAC address every 10 minutes or so. My approach was to ping all of the possible IP addresses on the network and call "arp -a" afterwards. The following code works to find if a device is registered on an IP address, but I don't know how to get the MAC address from this. try { String currentIP = InetAddress.getLocalHost().toString(); String subnet = getSubnet(currentIP); System.out.println("subnet: " + subnet); for (int i=1;i<254;i++){ String host = subnet + i; System.out

Impossible to pass the router service to a twig extension in symfony 2.6

非 Y 不嫁゛ 提交于 2019-12-06 01:04:51
I have a twig extension where I'm trying to inject the router service, so... services.yml app.twig_extension: class: SeoReportBundle\Twig\SeoReportExtension arguments: [@router] tags: - { name: twig.extension } Extension: use Symfony\Bundle\FrameworkBundle\Routing\Router; class SeoReportExtension extends \Twig_Extension { private $router; public function __construct(Router $router) { $this->router = $router; } When I execute the code I get this error: Catchable Fatal Error: Argument 1 passed to SeoReportBundle\Twig\SeoReportExtension::__construct() must be an instance of Symfony\Bundle

redirect to a route after api call in angular2

夙愿已清 提交于 2019-12-05 21:26:34
I need to redirect the user to a different component after processing (via api) the data user submitted through form. Below is the code I tried. In component onSubmit(model){ if(model.valid === true) { this.SharedService.postFormdata(model).subscribe( data => { console.log(data)}, error => Observable.throw(error); ); this.router.navigate(['PublicPage']); } } However, after call completed, its not redirecting to PublicPage component. Any help please. Thanks. tushar balar import { Router } from '@angular/router'; export class HeroesComponent { constructor(private router: Router) { } onSubmit

ZMQ Pattern Dealer/Router HeartBeating

匆匆过客 提交于 2019-12-05 20:00:05
I have a Dealer socket in client side, who is connected to Router socket in server side. I often see Heartbeating mechanism : the server regularly send message to the client in order that client knows if he is correctly connect to the server, so the client can reconnect if he doesn't received message for some times. For example the Paranoid Pirate pattern here : http://zguide.zeromq.org/page:chapter4 But after some tests : if the client loose the connection to the server for a moment and find it again, the client is automatically reconnected to the server socket (he receive sended message...).

Nodejs include socket.io in router page

纵饮孤独 提交于 2019-12-05 19:08:17
I have an express node app, and I'm trying to keep my code neat by not having all the socket.io stuff in app.js I don't know the best way to go about this. Here is my initial thought which doesn't feel like the cleanest one // app.js var express = require('express') , app = express() , server = require('http').createServer(app) , url = require('url') , somePage = require('./routes/somePage.js') , path = require('path'); app.configure(function(){...}); app.get('/', somePage.index); and the route // somePage.js exports.index = function (req, res, server) { io = require('socket.io').listern

Angular 2 nested routes resolve execution

≯℡__Kan透↙ 提交于 2019-12-05 18:47:15
问题 For example if I have following route organization: const appRoutes: Routes = [ { path: "", component: AppComponent, resolve: { app: AppResolver }, children: [ { path: "", component: NestedComponent, resolve: { subscribers: NestedResolver } } ] } ]; and following resolvers: export class AppResolver implements Resolve<any> { constructor(private appService: AppService) {} resolve(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable<any> { return this.appService.getAppData(); }

can one computer have two mac addresses?

£可爱£侵袭症+ 提交于 2019-12-05 17:43:02
问题 I hope this was the right place to post this, sorry if it isn't. Also, I know next to nothing about networks. I'm trying to allocate bandwidth to different devices on my Linksys E1200 router. When I check my computer's MAC address, it comes back as 74:E5:0B:10:01:04 . I turned off everything in my apartment besides my xbox and notebook, and under the DHCP client table under my router settings I see the xbox along with " Owner-PC " and a MAC address of 00:21:6B:10:A8:6E . Is this my computer,

hide id or query string while passing through react router

眉间皱痕 提交于 2019-12-05 16:44:32
i am having route where i pass id,but i dont want to show id in url, `<Route path={`${match.url}invite-members/:groupID`} exact component={InviteMembers} />` this gets converted in url https://local..../invite-members/5 , but instead of that i want https://local..../invite-members , but the functionality should remain the same as in i get id in invite-members through this.props.match.params.groupID should be as it is,please help using react router "react-router-dom": "^4.2.2", If you want to change url to '/invite-members', you can add the Redirect component. And in case you want to save

React Router with params navigatin back needs double click

狂风中的少年 提交于 2019-12-05 13:23:48
Simple question. When I'm in a for instance /dashboard router and I click on <Link to="/users/:userID" > router and try to go back to /dashboard it works wine , but when from /users/:userID router I navigate to another /users/:userID router and try to go back I need to click the back button twice , any idea why? e.g. /dashboard -> /users/1 and back ( 1 click needed ) /dashboard -> /users/1 - > /users/2 and back to /users/1 ( 2 clicks needed ) Here is my Route in App.js <Route path='/users/:userId' render={()=><User/>} /> Here is my User.jsx render() render() { let movie = this.props

How do BitTorrents connect with eachother?

◇◆丶佛笑我妖孽 提交于 2019-12-05 12:36:14
I was just downloading a new distro of linux using uTorrent, and started to wonder how uTorrent (and other bittorrents) send files to eachother through NAT routers? They obviously use the trackers to get introduced, but how do they pass info to eachother? Is there a whitepaper on this? I couldn't find one :/ Thanks Most of the time, they don't. I have a restricted network, and every time I run my torrent program it warns me that some of the ports/functionality required is not available to me. If one party has a restricted network and another has an open network, the restricted client will