IP address

Blitz3D Forums/Blitz3D Programming/IP address

FirstTheIdea(Posted 2005) [#1]
Is there anyway of find out what an IP number is from
AcceptTCPStream. Also have can you find out your computers current IP number's.

Basicaly I am creating an server and I want to know what IP the connections to server are coming from.


_PJ_(Posted 2005) [#2]
you can use

START MENU / RUN / ipconfig

to find out your own computers IP, MAC, etc. addresses.

As far as finding out about an incoming TCP stream, I dunno.........

www.whois.com


jfk EO-11110(Posted 2005) [#3]
if you're behind a router, you may have a Subnet IP like 192.168.0.3 or so. This isn't the IP the web will see of you. You can use several tricks to determine your real IP. Probably it's the easiest way to access a webpage that returns your IP, like www.whatismyip.com and then extract the ip from the http feed.


FirstTheIdea(Posted 2005) [#4]
There has to be an way of knowing what is the IP address of incomming data. Well how would you reply if dont know where came from in the first place.


Storm8191(Posted 2005) [#5]
R7T: I know with UDP you can get the IP address, just by the integer returned from Blitz's RecvUDPMsg() function. I bet Blitz has a similar command for TCP.


Wayne(Posted 2005) [#6]
1. Looked in the documentation and seems these two lines are what you're after:

strStream=AcceptTCPStream(svrGame)
intIP=TCPStreamIP( strStream )

2. Local IP's

; Display all local user IP's
;
Print "Local IPs:"
For i=1 To CountHostIPs(GetEnv("localhost"))
Print DottedIP(HostIP(i))
Next

3. Read the documentation and check the code archives next time.

TCPStreamIP( tcp_stream )
Parameters
tcp_stream - TCP stream handle

Description
Returns the integer IP address of the specified tcp_stream. The address returned is always that of the client machine.

RecvUDPMsg( udp_stream )
Parameters
udp_stream - UDP stream handle

Description
Receives a UDP message into the specified UDP stream. Standard stream read commands can then be used to examine the message.

The return value is the integer IP address of the message source, or 0 if no message was available. You can use UDPMsgPort() to find out the port number of the message source.


FirstTheIdea(Posted 2005) [#7]
I wish that did at time had the doc's they did not exist yestorday. Mark only uploaded them yestorday! This has been something BlitzPlus user's have been getting very upset about!

http://www.blitzbasic.com/Community/posts.php?topic=42359


WolRon(Posted 2005) [#8]
That's really no excuse. Both manuals are online.


FirstTheIdea(Posted 2005) [#9]
Thats, ture, so are going to pay phone bill, how kind of you!