BlitzMax/Modules/Vertex/BNetEx

BNetEx is a network module made by Vertex. It's Open Source, object-oriented and supports both TCP and UDP.

New versions are announced in this thread: [1]

Data StructuresEdit

TNetworkEdit

FunctionsEdit

GetHostIPEdit

Signature GetHostIP:Int(HostName:String)

Returns the IP address of the given host

Example

int_ip:Int = TNetwork.GetHostIP("www.blitzbasic.com")
Print TNetwork.StringIP(int_ip)

GetHostIPsEdit

Signature GetHostIPs:Int[](HostName:String)

A host may have several addresses at once which can be found out by this function

Example

Local int_ip:Int[] = TNetwork.GetHostIPs("www.google.com")
For Local i:Int = EachIn int_ip
   Print TNetwork.StringIP(i)
Next

GetHostNameEdit

Signature GetHostName:String(HostIp:Int)

Returns a given host's name

Example

Print "The local PC's name is: " + TNetwork.getHostName(TNetwork.IntIP("127.0.0.1"))

StringIPEdit

Signature StringIP:String(IP:Int)

Converts an integer IP into a string IP (also known as "dotted IP")

Example

int_ip:Int = TNetwork.GetHostIP("www.blitzbasic.com")
Print TNetwork.StringIP(int_ip)

IntIPEdit

Signature IntIP:Int(IP:String)

Converts a string IP into an integer IP

Example

Print "The local PC's name is: " + TNetwork.getHostName(TNetwork.IntIP("127.0.0.1"))

TNetStreamEdit

TNetStream extends TStream, therefore the usual write/read operations may be used on it. It contains all methods that can be used regardless of the protocol being used (TCP/UDP)