ip-address

ReachabilityWithAddress error giving it an ip address

余生颓废 提交于 2019-12-07 18:50:02
问题 hey Im trying to see if I can connect to an IP address. My code atm: #import "ViewController.h" #import "SystemConfiguration/SystemConfiguration.h" @implementation ViewController struct sockaddr_in ; - (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view, typically from a nib. Reachability *d = [Reachability reachabilityWithAddress:const struct sockaddr_in ???????]; NetworkStatus internetStatus = [d currentReachabilityStatus]; //NetworkStatus

Using Nodejs, Express and AngularJS to display IP in the browser

淺唱寂寞╮ 提交于 2019-12-07 17:32:03
问题 I'm learning Nodejs and ExpressJS. I'm trying to use ExpressJS and 2 Node modules (request-ip and geoip2) to get the client IP address for geolocation and then outputting the geolocation in the browser using AngularJS (1.x). So far for my Nodejs and Expressjs code I have var express = require('express'); // require request-ip and register it as middleware var requestIp = require('request-ip'); // to convert the ip into geolocation coords var geoip2 = require('geoip2'); // Init app var app =

How to get device type from MAC or IP address?

戏子无情 提交于 2019-12-07 17:25:18
问题 I am making a Device Discovery windows application in C#. Is this possible to know the device type if I have MAC address or IP address? device type means either it is computer or router or mobile or any other device? Note: HostName entry is not useful for it because Host Name is defined by User. for example i may assign "Nokia N70" name to my computer. Thanks in anticipation. 回答1: You can get the manufacturer from the MAC address. In order to get any more information you'd need to do a port

Determine if net mask is valid in Java

岁酱吖の 提交于 2019-12-07 16:06:57
问题 What is the easiest way in Java 6 to determine whether a given address is a valid net mask? I have found one solution which basically creates an array of valid IPs to use in a comparison (i.e. "255.255.255.255", "255.255.255.254", "255.255.255.252", etc...). Is there an easier way or is this the best way? 回答1: If you're happy to include an external dependency, then Apache's commons.net may have what you're looking for. Have a look at SubnetUtils and its SubnetInfo nested class. You can

Connect to IP Camera Using Emgu CV's Capture = New Capture()

爱⌒轻易说出口 提交于 2019-12-07 15:43:35
Using Visual Basic 2008 and Emgu CV, I can capture the stream of a webcam on my PC. What I want to do is connect to an IP camera, knowing its URL, using Capture = New Capture(). Here is the code I have: Imports Emgu.CV Imports Emgu.CV.Util Imports Emgu.CV.Structure Public Class Form1 Dim capturez As Capture = New Capture("rtsp://[IP Address]/mpeg4/media.amp") Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick Dim imagez As Image(Of Bgr, Byte) = capturez.QueryFrame() PictureBox1.Image = imagez.ToBitmap() End Sub End Class I get the following

How to access Java servlet running on my PC from outside?

不打扰是莪最后的温柔 提交于 2019-12-07 13:18:39
问题 I used Netbeans6.7 to write a servlet, when it runs, it opens a browser window with this address : http://localhost:8080/My_App/Test_Servlet, I replaced the "localhost" with my IP address, now it looks like this : http://192.???.1.??:8080/My_App/Test_Servlet, but I tried to access it from another computer outside my home, it can't read anything, I wonder if I need to change Windows Fire Wall setting to allow outside traffic, it's a Paypal IPN app, so I call Paypal, they said they can't access

How do you store an IP Address (v4 or v6) as an int in any database using php?

♀尐吖头ヾ 提交于 2019-12-07 09:01:19
问题 I need to store IP address in the most compact way possible, searching is not a concern. This also needs to be compatible on Windows, Linux, and Mac using any DB (MySQL, SQLite, Postgres, etc). Thanks to the ip2long() and long2ip() functions in PHP I can convert a IP4 address to a small int field rather than a varchar(15) or whatever. The problem is that we are in a transition stage to IP6 which means that most of the existing best-practices are failing - including those functions which don't

How to get Wi-Fi router IP address on iOS?

情到浓时终转凉″ 提交于 2019-12-07 04:46:52
问题 Is there any way to get Wi-Fi router IP address on iOS from my application? With help of getifaddrs(struct ifaddrs **) method I can get interface address, subnet mask, broadcast address, but cannot get router address. I have found a lot of solutions for Mac OS, but not for iOS. Any solutions for iOS? 来源: https://stackoverflow.com/questions/24887904/how-to-get-wi-fi-router-ip-address-on-ios

Need help getting TCP port number and IP address in C

自作多情 提交于 2019-12-07 04:44:23
问题 I'm trying to find a way to get my server to print its TCP Port Number and IP address but how I have it right now is producing the wrong IP, I am getting an output of 0.0.33.32. Any help is appreciated! #include <stdio.h> #include <stdlib.h> #include <unistd.h> #include <errno.h> #include <string.h> #include <sys/types.h> #include <sys/socket.h> #include <netinet/in.h> #include <netdb.h> #include <arpa/inet.h> #include <sys/wait.h> #include <signal.h> #include <time.h> #define PORT "21467" //

Getting IPAddress via a proxy with PHP?

守給你的承諾、 提交于 2019-12-07 03:54:07
问题 I run security checks on a number of AJAX calls to see if the same IP requested that I have on record. I used the following set of class functions to establish the IP (which can come via load balancers, hence the lengthly methodology. private function IPMask_Match ($network, $ip) { $ip_arr = explode('/', $network); if (count($ip_arr) < 2) { $ip_arr = array($ip_arr[0], null); } $network_long = ip2long($ip_arr[0]); $x = ip2long($ip_arr[1]); $mask = long2ip($x) == $ip_arr[1] ? $x : 0xffffffff <<