I search for solutions in this order: Past Code, Unreal Source, Wiki, BUF, groups.yahoo, google, screaming at monitor. – RegularX

Difference between revisions of "UE2:InternetLink (UT2004)"

From Unreal Wiki, The Unreal Engine Documentation Site
Jump to: navigation, search
(Auto-generated page)
 
(added most descriptions)
Line 15: Line 15:
 
'''[[Variables#Modifiers|Modifiers]]:''' const
 
'''[[Variables#Modifiers|Modifiers]]:''' const
  
<!-- enter variable description -->
+
Internal hint whether data is available (1) or not (0).
  
 
====InLineMode====
 
====InLineMode====
 
'''Type:''' {{tl|ELineMode}}
 
'''Type:''' {{tl|ELineMode}}
  
<!-- enter variable description -->
+
When in event receive mode and line link mode, this property tells which line break type to use for received string data.
  
 
====LinkMode====
 
====LinkMode====
 
'''Type:''' {{tl|ELinkMode}}
 
'''Type:''' {{tl|ELinkMode}}
  
<!-- enter variable description -->
+
Specifies what kind of data is expected to be received or sent. When sending text data in link mode "line", a line break is appended according to the {{tl|OutLineMode}} property.
  
 
====OutLineMode====
 
====OutLineMode====
 
'''Type:''' {{tl|ELineMode}}
 
'''Type:''' {{tl|ELineMode}}
  
<!-- enter variable description -->
+
Specifies the type of line break to append when sending text data in link mode "line".
  
 
====Port====
 
====Port====
Line 37: Line 37:
 
'''[[Variables#Modifiers|Modifiers]]:''' const
 
'''[[Variables#Modifiers|Modifiers]]:''' const
  
<!-- enter variable description -->
+
Contains the locally bound port after a port has been bound e.g. with {{tl|BindPort|TcpLink}}().
  
 
====PrivateResolveInfo====
 
====PrivateResolveInfo====
Line 44: Line 44:
 
'''[[Variables#Modifiers|Modifiers]]:''' private, native, const
 
'''[[Variables#Modifiers|Modifiers]]:''' private, native, const
  
<!-- enter variable description -->
+
An internal pointer used for resolving DNS names into IP addresses.
  
 
====ReceiveMode====
 
====ReceiveMode====
 
'''Type:''' {{tl|EReceiveMode}}
 
'''Type:''' {{tl|EReceiveMode}}
  
<!-- enter variable description -->
+
Specifies whether events should be called when data is received or the code will manually retrieve data using the appropriate read functions.
  
 
====RemoteSocket====
 
====RemoteSocket====
Line 56: Line 56:
 
'''[[Variables#Modifiers|Modifiers]]:''' const
 
'''[[Variables#Modifiers|Modifiers]]:''' const
  
<!-- enter variable description -->
+
The remote socket for connected {{cl|TcpLink}} instances.
  
 
====Socket====
 
====Socket====
Line 63: Line 63:
 
'''[[Variables#Modifiers|Modifiers]]:''' const
 
'''[[Variables#Modifiers|Modifiers]]:''' const
  
(sockets are 64-bit on AMD64, so use "pointer").
+
The local socket.
  
 
==Enums==
 
==Enums==
 
====ELineMode====
 
====ELineMode====
<!-- enter enum description -->
+
Specifies a line break type for link mode "line".
; LMODE_auto : <!-- enter enum value description -->
+
; LMODE_auto : Allows any line break type for received text, appends DOS line break (CRLF) when sending text.
 
; LMODE_DOS : CRLF
 
; LMODE_DOS : CRLF
 
; LMODE_UNIX : LF
 
; LMODE_UNIX : LF
Line 74: Line 74:
  
 
====ELinkMode====
 
====ELinkMode====
<!-- enter enum description -->
+
Specifies whether binary data or text is expected to be sent or received.
; MODE_Text : <!-- enter enum value description -->
+
; MODE_Text : The received data is expected to be text. When sending text, no line break is appended. When receiving text, it is not split at line breaks.
; MODE_Line : <!-- enter enum value description -->
+
; MODE_Line : The received data is expected to be text. When sending text, a line break according to the {{tl|OutLineMode}} is appended. When receiving text, it is split at the type of line break specified by {{tl|InLineMode}} and that line break is discarded.
; MODE_Binary : <!-- enter enum value description -->
+
; MODE_Binary : The received data is expected to be binary data. When sending or reading text, this mode behaves exactly like '''MODE_Text'''.
  
 
====EReceiveMode====
 
====EReceiveMode====
<!-- enter enum description -->
+
Specifies whether received data is read manually or provided automatically by calling the appropriate event.
; RMODE_Manual : <!-- enter enum value description -->
+
; RMODE_Manual : Received data will be read by the read functions defined in subclasses.
; RMODE_Event : <!-- enter enum value description -->
+
; RMODE_Event : Received data will be provided by calling the received events defined in subclasses.
  
 
==Structs==
 
==Structs==
 
===IpAddr===
 
===IpAddr===
<!-- enter struct description -->
+
An IP address and port number.
; [[int]] Addr : <!-- enter variable description -->
+
; [[int]] Addr : The IP address.
; [[int]] Port : <!-- enter variable description -->
+
; [[int]] Port : The port number.
  
 
==Functions==
 
==Functions==
Line 110: Line 110:
 
{{code|native function '''GetLocalIP''' (out&nbsp;{{tl|IpAddr}}&nbsp;'''Arg''')}}
 
{{code|native function '''GetLocalIP''' (out&nbsp;{{tl|IpAddr}}&nbsp;'''Arg''')}}
  
<!-- enter function description -->
+
Returns the local IP address and port 0.
  
 
====IpAddrToString====
 
====IpAddrToString====
 
{{code|native function [[string]]&nbsp;'''IpAddrToString''' ({{tl|IpAddr}}&nbsp;'''Arg''')}}
 
{{code|native function [[string]]&nbsp;'''IpAddrToString''' ({{tl|IpAddr}}&nbsp;'''Arg''')}}
  
<!-- enter function description -->
+
Converts the {{tl|IpAddr}} value into a readable IP:Port string, e.g. "123.45.67.89:12345".
  
 
====IsDataPending====
 
====IsDataPending====
 
{{code|native function [[bool]]&nbsp;'''IsDataPending''' ()}}
 
{{code|native function [[bool]]&nbsp;'''IsDataPending''' ()}}
  
<!-- enter function description -->
+
Returns whether the socket has received data that was not yet read by calling the appropriate read functions.
  
 
====ParseURL====
 
====ParseURL====
 
{{code|native function [[bool]]&nbsp;'''ParseURL''' (coerce&nbsp;[[string]]&nbsp;'''URL''', out&nbsp;[[string]]&nbsp;'''Addr''', out&nbsp;[[int]]&nbsp;'''Port''', out&nbsp;[[string]]&nbsp;'''LevelName''', out&nbsp;[[string]]&nbsp;'''EntryName''')}}
 
{{code|native function [[bool]]&nbsp;'''ParseURL''' (coerce&nbsp;[[string]]&nbsp;'''URL''', out&nbsp;[[string]]&nbsp;'''Addr''', out&nbsp;[[int]]&nbsp;'''Port''', out&nbsp;[[string]]&nbsp;'''LevelName''', out&nbsp;[[string]]&nbsp;'''EntryName''')}}
  
<!-- enter function description -->
+
Attempts to parse a URL string like "protocol://host:port/path?options#anchor" (all parts are optional) and returns the host part as address, the port and (if its an internal URL to a local map or game server) the path as map name and the anchor as entry point name. Returns whether the URL string looked valid.
  
 
====Resolve====
 
====Resolve====
 
{{code|native function '''Resolve''' (coerce&nbsp;[[string]]&nbsp;'''Domain''')}}
 
{{code|native function '''Resolve''' (coerce&nbsp;[[string]]&nbsp;'''Domain''')}}
  
<!-- enter function description -->
+
Resolves the specified DNS name or IP address string. The resolve result is returned by calling {{tl|Resolved}}() when resolving was successful. When an IP address string is specified, it is converted and returned immediately via {{tl|Resolved}}(). (The '''Resolved()''' call happens within the '''Resolve()''' call, i.e. be careful when calling '''Resolve()''' from '''Resolved()''' with IP address strings. Consider using {{tl|StringToIpAddr}}() instead.)
  
 
====StringToIpAddr====
 
====StringToIpAddr====
 
{{code|native function [[bool]]&nbsp;'''StringToIpAddr''' ([[string]]&nbsp;'''Str''', out&nbsp;{{tl|IpAddr}}&nbsp;'''Addr''')}}
 
{{code|native function [[bool]]&nbsp;'''StringToIpAddr''' ([[string]]&nbsp;'''Str''', out&nbsp;{{tl|IpAddr}}&nbsp;'''Addr''')}}
  
<!-- enter function description -->
+
Converts the specified IP address string to an {{tl|IpAddr}} value and returns whether the string represented a valid IP address. Specifying a port is not supported!
  
 
===Events===
 
===Events===
Line 141: Line 141:
 
{{code|event '''Resolved''' ({{tl|IpAddr}}&nbsp;'''Addr''')}}
 
{{code|event '''Resolved''' ({{tl|IpAddr}}&nbsp;'''Addr''')}}
  
<!-- enter event description -->
+
Called when a {{tl|Resolve}}() operation completed successfully. May be called directly from within '''Resolve()''' if the string to resolve represented an IP address.
  
 
====ResolveFailed====
 
====ResolveFailed====
 
{{code|event '''ResolveFailed''' ()}}
 
{{code|event '''ResolveFailed''' ()}}
  
<!-- enter event description -->
+
Called when a {{tl|Resolve}}() operation failed. May be called directly from within '''Resolve()''' if the string to resolve represented the IP address <code>255.255.255.255</code>.

Revision as of 08:55, 27 April 2014

UT2004 Object >> Actor >> Info >> InternetInfo >> InternetLink
Package: 
IpDrv
Direct subclasses:
TcpLink, UdpLink
This class in other games:
RTNP, U1, UT, U2XMP, U2, UE2Runtime, UT2003, UT3, UDK

InternetLink: Parent class for Internet connection classes

Properties

DataPending

Type: int

Modifiers: const

Internal hint whether data is available (1) or not (0).

InLineMode

Type: ELineMode

When in event receive mode and line link mode, this property tells which line break type to use for received string data.

LinkMode

Type: ELinkMode

Specifies what kind of data is expected to be received or sent. When sending text data in link mode "line", a line break is appended according to the OutLineMode property.

OutLineMode

Type: ELineMode

Specifies the type of line break to append when sending text data in link mode "line".

Port

Type: int

Modifiers: const

Contains the locally bound port after a port has been bound e.g. with TcpLink.BindPort().

PrivateResolveInfo

Type: pointer

Modifiers: private, native, const

An internal pointer used for resolving DNS names into IP addresses.

ReceiveMode

Type: EReceiveMode

Specifies whether events should be called when data is received or the code will manually retrieve data using the appropriate read functions.

RemoteSocket

Type: pointer

Modifiers: const

The remote socket for connected TcpLink instances.

Socket

Type: pointer

Modifiers: const

The local socket.

Enums

ELineMode

Specifies a line break type for link mode "line".

LMODE_auto 
Allows any line break type for received text, appends DOS line break (CRLF) when sending text.
LMODE_DOS 
CRLF
LMODE_UNIX 
LF
LMODE_MAC 
LFCR

ELinkMode

Specifies whether binary data or text is expected to be sent or received.

MODE_Text 
The received data is expected to be text. When sending text, no line break is appended. When receiving text, it is not split at line breaks.
MODE_Line 
The received data is expected to be text. When sending text, a line break according to the OutLineMode is appended. When receiving text, it is split at the type of line break specified by InLineMode and that line break is discarded.
MODE_Binary 
The received data is expected to be binary data. When sending or reading text, this mode behaves exactly like MODE_Text.

EReceiveMode

Specifies whether received data is read manually or provided automatically by calling the appropriate event.

RMODE_Manual 
Received data will be read by the read functions defined in subclasses.
RMODE_Event 
Received data will be provided by calling the received events defined in subclasses.

Structs

IpAddr

An IP address and port number.

int Addr 
The IP address.
int Port 
The port number.

Functions

Native functions

GameSpyGameName

native function string GameSpyGameName ()


GameSpyValidate

native function string GameSpyValidate (string ValidationString)


GetLastError

native function int GetLastError ()


GetLocalIP

native function GetLocalIP (out IpAddr Arg)

Returns the local IP address and port 0.

IpAddrToString

native function string IpAddrToString (IpAddr Arg)

Converts the IpAddr value into a readable IP:Port string, e.g. "123.45.67.89:12345".

IsDataPending

native function bool IsDataPending ()

Returns whether the socket has received data that was not yet read by calling the appropriate read functions.

ParseURL

native function bool ParseURL (coerce string URL, out string Addr, out int Port, out string LevelName, out string EntryName)

Attempts to parse a URL string like "protocol://host:port/path?options#anchor" (all parts are optional) and returns the host part as address, the port and (if its an internal URL to a local map or game server) the path as map name and the anchor as entry point name. Returns whether the URL string looked valid.

Resolve

native function Resolve (coerce string Domain)

Resolves the specified DNS name or IP address string. The resolve result is returned by calling Resolved() when resolving was successful. When an IP address string is specified, it is converted and returned immediately via Resolved(). (The Resolved() call happens within the Resolve() call, i.e. be careful when calling Resolve() from Resolved() with IP address strings. Consider using StringToIpAddr() instead.)

StringToIpAddr

native function bool StringToIpAddr (string Str, out IpAddr Addr)

Converts the specified IP address string to an IpAddr value and returns whether the string represented a valid IP address. Specifying a port is not supported!

Events

Resolved

event Resolved (IpAddr Addr)

Called when a Resolve() operation completed successfully. May be called directly from within Resolve() if the string to resolve represented an IP address.

ResolveFailed

event ResolveFailed ()

Called when a Resolve() operation failed. May be called directly from within Resolve() if the string to resolve represented the IP address 255.255.255.255.