< BlitzMax < Modules < Vertex

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:

Data Structures

TNetwork

Functions

GetHostIP

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)

GetHostIPs

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

GetHostName

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"))

StringIP

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)

IntIP

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"))

TNetStream

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)

This article is issued from Wikibooks. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.