BlitzMax

BlitzMax

  • Downloads
  • Docs
  • API
  • Resources
  • About

›BRL

BlitzMax API

  • Introduction

BRL

    Audio

    • Introduction
    • TChannel
    • TSound

    AudioSample

    • Introduction
    • TAudioSample
    • TAudioSampleLoader

    Bank

    • Introduction
    • TBank

    BankStream

    • Introduction
    • TBankStream

    Base64

    • Introduction
    • TBase64

    Blitz

    • Introduction
    • TArrayBoundsException
    • TBlitzException
    • TNullFunctionException
    • TNullMethodException
    • TNullObjectException
    • TOutOfDataException
    • TRuntimeException
  • BRL.BMPLoader
  • Clipboard

    • Introduction
    • TClipboard
    • TClipboardOpts
    • TWin32ClipboardOpts
    • TX11ClipboardOpts
  • BRL.D3D7Max2D
  • BRL.D3D9Max2D
  • BRL.DirectSoundAudio
  • BRL.EndianStream
  • Event

    • Introduction
    • TEvent
  • BRL.EventQueue
  • BRL.FileSystem
  • BRL.FreeAudioAudio
  • BRL.GLGraphics
  • BRL.GLMax2D
  • BRL.GNet
  • BRL.Graphics
  • BRL.Hook
  • IO

    • Introduction
    • MaxIO
  • BRL.JPGLoader
  • BRL.KeyCodes
  • LinkedList

    • Introduction
    • TList
    • TListEnum
    • TLink

    Map

    • Introduction
    • TMap
    • TIntMap
    • TIntKey
    • TPtrMap
    • TPtrKey
    • TStringMap
  • BRL.Math
  • Matrix

    • Introduction
    • SMat2D
    • SMat2F
    • SMat2I
    • SMat3D
    • SMat3F
    • SMat3I
    • SMat4D
    • SMat4F
    • SMat4I

    Max2D

    • Introduction
    • TImage

    MaxLua

    • Introduction
    • TLuaClass
    • TLuaObject
  • BRL.OGGLoader
  • BRL.OpenALAudio
  • ObjectList

    • Introduction
    • TObjectList
    • TObjectListEnumerator
    • TObjectListReverseEnumerator

    Pixmap

    • Introduction
    • TPixmap
    • TPixmapLoader
  • BRL.PNGLoader
  • BRL.PolledInput
  • Quaternion

    • Introduction
    • SQuatD
    • SQuatF
    • SQuatI
  • BRL.RamStream
  • Random

    • Introduction
    • TRandom

    Reflection

    • Introduction
    • TTypeId
    • TMember
    • TConstant
    • TField
    • TGlobal
    • TFunction
    • TMethod
  • BRL.Retro
  • BRL.Socket
  • BRL.SocketStream
  • BRL.StandardIO
  • Stream

    • Introduction
    • TCStream
    • TIO
    • TStream
    • TStreamException
    • TStreamFactory
    • TStreamReadException
    • TStreamWrapper
    • TStreamWriteException

    StringBuilder

    • Introduction
    • TStringBuilder
    • TSplitBuffer
  • BRL.System
  • BRL.SystemDefault
  • BRL.TextStream
  • BRL.TGALoader
  • ThreadPool

    • Introduction
    • TRunnable
    • TThreadPoolExecutor

    Threads

    • Introduction
    • TThread
    • TThreadData
    • TMutex
    • TSemaphore
    • TCondVar

    Timer

    • Introduction
    • TChrono
  • BRL.TimerDefault
  • Vector

    • Introduction
    • SVec2D
    • SVec2F
    • SVec2I
    • SVec3D
    • SVec3F
    • SVec3I
    • SVec4D
    • SVec4F
    • SVec4I

    Volumes

    • Introduction
    • TVolume
  • BRL.WAVLoader

Text

    CSV

    • Introduction
    • TCsvParser
    • TCsvHeader
    • TCsvRow
    • TCsvOptions
    • SCsvColumn

    Format

    • Introduction
    • TFormatter

    Ini

    • Introduction
    • TIni
    • TIniProperty
    • TIniSection

    JConv

    • Introduction
    • TJConv
    • TJConvBuilder
    • TJConvSerializer

    Json

    • Introduction
    • TJSON
    • TJSONObject
    • TJSONString
    • TJSONInteger
    • TJSONReal
    • TJSONBool
    • TJSONArray
    • TJSONNull
    • TJSONError
    • TJSONNumber

    Regex

    • Introduction
    • TRegEx
    • TRegExMatch
    • TRegExOptions
    • TRegExException

    TOML

    • Introduction
    • ETomlNodeType
    • TToml
    • ITomlNode
    • STomlDate
    • STomlDateTime
    • STomlTime
    • TTomlArray
    • TTomlInteger
    • TTomlString
    • TTomlTable
    • TTomlBoolean

    Xml

    • Introduction
    • TxmlDoc
    • TxmlNode
    • TxmlAttribute

MaxGUI

  • MaxGUI.MaxGUI
  • MaxGUI.Drivers
  • MaxGUI.Localization
  • MaxGUI.ProxyGadgets
  • MaxGUI.CocoaMaxGUI
  • MaxGUI.Win32MaxGUIEx

PUB

  • Pub.FreeJoy
  • Pub.FreeProcess
  • Pub.Glad
  • Pub.Glew
  • Joystick

    • Introduction
    • TJoystickDriver
  • Pub.Lua
  • Pub.OpenAL
  • Pub.OpenGLES
  • Pub.xmmintrin
  • Pub.ZLib

Crypto

    Digest

    • Introduction
    • TMessageDigest
    • TDigestRegister
    • TNoSuchAlgorithmException

    Cipher

    • Introduction
    • TCipher
    • TCipherMode
    • Crypto.AESCipher
    • Crypto.AnubisCipher
    • Crypto.BlowfishCipher
    • Crypto.CamelliaCipher
    • Crypto.Cast5Cipher
    • Crypto.DESCipher
    • Crypto.IdeaCipher
    • Crypto.KasumiCipher
    • Crypto.KhazadCipher
    • Crypto.KSeedCipher
    • Crypto.NoekeonCipher
    • Crypto.SerpentCipher
    • Crypto.SkipjackCipher
    • Crypto.TwofishCipher
    • Crypto.XTeaCipher

    CBCMode

    • Introduction
    • TCBCCipherMode

    CFBMode

    • Introduction
    • TCFBCipherMode

    CTRMode

    • Introduction
    • TCTRCipherMode

    ECBMode

    • Introduction
    • TECBCipherMode

    F8Mode

    • Introduction
    • TF8CipherMode

    LRWMode

    • Introduction
    • TLRWCipherMode

    OFBMode

    • Introduction
    • TOFBCipherMode

    XTSMode

    • Introduction
    • TXTSCipherMode

    Blake2BDigest

    • Introduction
    • TBlake2B_512
    • TBlake2B_384
    • TBlake2B_256
    • TBlake2B_160

    CRC32

    • Introduction
    • TCRC32

    MD5Digest

    • Introduction
    • TMD5

    Ripemd320Digest

    • Introduction
    • TRipemd320

    Ripemd356Digest

    • Introduction
    • TRipemd256

    Ripemd160Digest

    • Introduction
    • TRipemd160

    Ripemd128Digest

    • Introduction
    • TRipemd128

    SHA1Digest

    • Introduction
    • TSHA1

    SHA256Digest

    • Introduction
    • TSHA256

    SHA512Digest

    • Introduction
    • TSHA512

    SHA3Digest

    • Introduction
    • TSHA3_512
    • TSHA3_384
    • TSHA3_256
    • TSHA3_224

    TigerDigest

    • Introduction
    • TTiger

    WhirlpoolDigest

    • Introduction
    • TWhirlpool

    Crypto

    • Introduction
    • TCryptoRandom
    • TCryptoSecretBox
    • TCryptoHash
    • TCryptoSign
    • TCryptoKeyExchange
    • TCryptoKey
    • TCryptoHashKey
    • TCryptoSecretBoxKey
    • TCryptoSignature
    • TCryptoExchangeKeyPair
    • TCryptoSessionKeyPair
    • TCryptoNPacket
    • TCryptoKK1Packet
    • TCryptoKK2Packet
    • TCryptoXX1Packet
    • TCryptoXX2Packet
    • TCryptoXX3Packet
    • TCryptoExchangeState
    • TCryptoPWHashMasterKey
    • TCryptoPWHashStoredKey
    • TCryptoPasswordHash

SDL

    SDL

    • Introduction
    • TSDLStream

    SDLSystem

    • Introduction
    • TSDLMultiGesture

    SDLVideo

    • Introduction
    • TSDLDisplay
    • TSDLDisplayMode
    • TSDLGLContext
    • TSDLWindow

    SDLRender

    • Introduction
    • TSDLRenderer
    • TSDLTexture

    SDLTimer

    • Introduction
    • TSDLTimer

    SDLHaptic

    • Introduction
    • TSDLHaptic
    • TSDLHapticCondition
    • TSDLHapticConstant
    • TSDLHapticCustom
    • TSDLHapticDirection
    • TSDLHapticEffect
    • TSDLHapticLeftRight
    • TSDLHapticPeriodic
    • TSDLHapticRamp

    SDLSensor

    • Introduction
    • TSDLSensor
  • SDL.SDLFreeAudio
  • SDL.GLSDLMax2D
  • SDL.GL2SDLMax2D
  • SDL.D3D9SDLMax2D
  • SDLVirtualJoystick

    • Introduction
    • TVirtualJoystick

Steam

    SteamSDK

    • Introduction
    • TSteamClient
    • TSteamUtils
    • TSteamUserStats
    • TSteamFriends
    • TSteamUGC
    • ISteamFriendsListener
    • ISteamUGCListener
    • ISteamUserStatsListener
    • ISteamUtilsListener
    • EItemPreviewType
    • EPersonaChange
    • EPersonaState
    • ERemoteStoragePublishedFileVisibility
    • EUGCMatchingUGCType
    • EUGCQuery
    • EUserRestriction
    • EUserUGCList
    • EWorkshopFileType
Edit

BRL.Socket

Functions

Function CreateUDPSocket:TSocket()

Create a UDP socket

The new socket is not bound to any local or remote address.

Returns

A new socket


Function CreateTCPSocket:TSocket()

Create a TCP socket

The new socket is not bound to any local or remote address.

Returns

A new socket


Function CloseSocket( socket:TSocket )

Close a socket

All sockets should eventually be closed. Once closed, a socket can no longer be used.


Function BindSocket( socket:TSocket, localPort, family:Int = AF_INET_)

Bind a socket to a local port

If localPort is 0, a new local port will be allocated. If localPort is not 0, BindSocket will fail if there is already an application bound to localPort.

Returns

True if successful, otherwise false


Function ConnectSocket( socket:TSocket, AddrInfo:TAddrInfo )

Connect a socket to a remote ip and port

For both UDP and TCP sockets, ConnectSocket will fail if the specified ip address could not be reached.

In the case of TCP sockets, ConnectSocket will also fail if there is no application listening at the remote port.

Returns

True if successful, otherwise false


Function SocketListen( socket:TSocket,backlog=0 )

Start listening at a socket

The specified socket must be a TCP socket, and must already be bound to a local port.


Function SocketAccept:TSocket( socket:TSocket,timeout=0 )

Accept new connections on a listening socket

The specified socket must be a TCP socket, and must be listening.

Returns

A new socket, or Null if no connection was made in the specified timeout


Function SocketConnected( socket:TSocket )

Get socket connection status

SocketConnected allows you to determine if a TCP connection is still alive or has been remotely closed.

SocketConnected should only be used with TCP sockets that have already connected via ConnectSocket or SocketAccept.

Returns

True if socket is connected


Function SocketReadAvail( socket:TSocket )

Get number of bytes available for reading from a socket

Returns

Number of bytes that may be read without causing the socket to block


Function SocketLocalIP:String( socket:TSocket )

Get local ip of a socket


Function SocketLocalPort( socket:TSocket )

Get local port of a socket


Function SocketRemoteIP:String( socket:TSocket )

Get remote ip of a socket


Function SocketRemotePort( socket:TSocket )

Get remote port of a socket


Function DottedIP$( ip:Int )

Convert an ip address to a dotted string

Returns

Dotted string version of ip address


Function DottedIPToInt:Int(addr:String)

Converts a dotted IPv4 string to an ip address.

Returns

An integer version of an ip address.


Function InetPton:Int(family:Int, src:String, dst:Byte Ptr)

Converts an IP address string into a binary representation.

For AF_INET_, dst should be an Int or 32-bit (4 bytes) in size. For AF_INET6_, dst should be 128-bits (16 bytes) in size.


Function HostIp:String( HostName$, index:Int=0, family:Int = AF_UNSPEC_ )

Convert a host name to an ip address

Returns

Host ip address, or 0 if host not found


Function HostIps:String[]( HostName$, family:Int = AF_UNSPEC_ )

Get all ip addresses for a host name

Returns

Array of host ips, or Null if host not found


Function HostName$( HostIp:String, family:Int = AF_UNSPEC_ )

Convert a host ip address to a name

Returns

Name of host, or Null if host not found


Function AddrInfo:TAddrInfo[](host:String, service:String = "http", family:Int = AF_UNSPEC_)

Returns an array of TAddrInfo objects.


Function AddrInfo:TAddrInfo[](host:String, service:String, hints:TAddrInfo)

Returns an array of TAddrInfo objects.


← BRL.RetroBRL.SocketStream →
  • Functions
    • Function CreateUDPSocket:TSocket()
    • Function CreateTCPSocket:TSocket()
    • Function CloseSocket( socket:TSocket )
    • Function BindSocket( socket:TSocket, localPort, family:Int = AF_INET_)
    • Function ConnectSocket( socket:TSocket, AddrInfo:TAddrInfo )
    • Function SocketListen( socket:TSocket,backlog=0 )
    • Function SocketAccept:TSocket( socket:TSocket,timeout=0 )
    • Function SocketConnected( socket:TSocket )
    • Function SocketReadAvail( socket:TSocket )
    • Function SocketLocalIP:String( socket:TSocket )
    • Function SocketLocalPort( socket:TSocket )
    • Function SocketRemoteIP:String( socket:TSocket )
    • Function SocketRemotePort( socket:TSocket )
    • Function DottedIP$( ip:Int )
    • Function DottedIPToInt:Int(addr:String)
    • Function InetPton:Int(family:Int, src:String, dst:Byte Ptr)
    • Function HostIp:String( HostName$, index:Int=0, family:Int = AF_UNSPEC_ )
    • Function HostIps:String[]( HostName$, family:Int = AF_UNSPEC_ )
    • Function HostName$( HostIp:String, family:Int = AF_UNSPEC_ )
    • Function AddrInfo:TAddrInfo[](host:String, service:String = "http", family:Int = AF_UNSPEC_)
    • Function AddrInfo:TAddrInfo[](host:String, service:String, hints:TAddrInfo)
BlitzMax
Docs
Getting StartedDownloadsAbout
Community
ResourcesSyntaxBomb Forums
More
GitHubStarChat on Discord
Copyright © 2023 Bruce A Henderson