Overview Package Class Source Class tree Glossary
previous class      next class frames      no frames

LibHTTP4.HttpSock

Extends
Info
Modifiers
config dependson ( HttpUtil )

HttpSock
Base of [[LibHTTP]] this implements the main network methods for connecting to a webserver and retreiving data from it. Binary data is not supported.
Dcoumentation and Information: http://wiki.beyondunreal.com/wiki/LibHTTP

Authors: Michiel 'El Muerte' Hendriks <elmuerte@drunksnipers.com>

Copyright 2003-2005 Michiel "El Muerte" Hendriks
Released under the Lesser Open Unreal Mod License
http://wiki.beyondunreal.com/wiki/LesserOpenUnrealModLicense

Core.Object
|   
+-- Engine.Actor
   |   
   +-- Engine.Info
      |   
      +-- LibHTTP4.HttpSock

Direct Known Subclasses:

UTANUplink

Constants Summary
BUFFERSIZE=2048
HTTP_CONNECT="CONNECT"
HTTP_DELETE="DELETE"
HTTP_GET="GET"
HTTP_HEAD="HEAD"
HTTP_OPTIONS="OPTIONS"
HTTP_POST="POST"
HTTP_PUT="PUT"
HTTP_TRACE="TRACE"
VERSION=401
Inherited Contants from Engine.Actor
MAXSTEPHEIGHT, MINFLOORZ

Variables Summary
array<string>authBasicLookup
boolbAuthTrap
boolbIsChunked
intBoundPort
boolbTempProxyOverride
boolbTimeout
boolbUseTempProxy
intchunkedCounter
HTTPCookiesCookies
stringCRLF
intCurRedir
HTTPStatecurState
stringEXTENTION
boolFollowingRedir
class<HttpCookies>HttpCookieClass
HttpLinkHttpLink
class<HttpLink>HttpLinkClass
stringHTTPVER
stringinBuffer
intLastStatus
InternetLink.IpAddrLocalLink
stringMultiPartBoundary
stringoutBuffer
boolprocHeader
array<string>RequestData
floatRequestDuration
array<string>RequestHeaders
array<RequestHistoryEntry>RequestHistory
stringRequestMethod
HttpResolveCacheResolveCache
stringResolveHostname
array<string>ReturnData
array<string>ReturnHeaders
floatStartRequestTime
HttpUtil.xURLTempProxy
intTZoffset
HttpUtilUtils
Authentication
array<GameInfo.KeyValuePair>AuthInfo
EAuthMethodAuthMethod
boolbAutoAuthenticate
Options
boolbFollowRedirect
boolbProcCookies
boolbRfcCompliantRedirect
boolbSendCookies
floatfConnectTimout
intiMaxRedir
intiVerbose
Proxy
boolbUseProxy
intiProxyPort
array<GameInfo.KeyValuePair>ProxyAuthInfo
EAuthMethodProxyAuthMethod
stringsProxyHost
stringsProxyPass
stringsProxyUser
URL
HttpUtil.xURLCurrentURL
stringDefaultAccept
intiLocalPort
XferMode
intiMaxBytesPerTick
intiMaxIterationsPerTick
ETransferModeTransferMode
Inherited Variables from Engine.Info
BotsGroup, ChatGroup, GameGroup, KickVoteGroup, MapVoteGroup, RulesGroup, ServerGroup
Inherited Variables from Engine.Actor
Acceleration, AccumKarmaAngleError, ActorRenderData, AmbientGlow, AmbientSound, AntiPortal, Attached, AttachmentBone, AttachTag, bAcceptsProjectors, bActorShadows, bAlreadyPrecachedMaterials, bAlreadyPrecachedMeshes, bAlwaysFaceCamera, bAlwaysRelevant, bAlwaysTick, bAlwaysZeroBoneOffset, bAnimByOwner, Base, bAttenByLife, bAutoAlignToTerrain, bBadStateCode, bBlockActors, bBlockKarma, bBlockNonZeroExtentTraces, bBlockPlayers, bBlockProjectiles, bBlocksTeleport, bBlockZeroExtentTraces, bBounce, bCanBeDamaged, bCanTeleport, bClientAnim, bClientAuthoritative, bClientDemoNetFunc, bClientDemoRecording, bClientTrigger, bCollideActors, bCollideWhenPlacing, bCollideWorld, bCompressedPosition, bCorona, bDeferRendering, bDeleteMe, bDemoOwner, bDemoRecording, bDestroyInPainVolume, bDetailAttachment, bDirectional, bDirectionalCorona, bDisableSorting, bDisturbFluidSurface, bDramaticLighting, bDynamicLight, bEdShouldSnap, bEdSnap, bFixedRotationDir, bForceSkelUpdate, bFullVolume, bGameRelevant, bHardAttach, bHidden, bHiddenEd, bHiddenEdGroup, bHighDetail, bHurtEntry, bIgnoreEncroachers, bIgnoreOutOfWorld, bIgnoreTerminalVelocity, bIgnoreVehicles, bInterpolating, bJustTeleported, bLightChanged, bLightingVisibility, bLockLocation, bMovable, bNetDirty, bNetInitial, bNetInitialRotation, bNetNotify, bNetOwner, bNetRelevant, bNetTemporary, bNoDelete, bNoRepMesh, bNotifyLocalPlayerTeamReceived, bNotOnDedServer, bObsolete, bOnlyAffectPawns, bOnlyDirtyReplication, bOnlyDrawIfAttached, bOnlyOwnerSee, bOnlyRelevantToOwner, bOrientOnSlope, bOrientToVelocity, bOwnerNoSee, bPathColliding, bPathTemp, bPendingDelete, bProjTarget, bRepClientDemo, bReplicateAnimations, bReplicateInstigator, bReplicateMovement, bRotateToDesired, Brush, bScriptInitialized, bSelected, bShadowCast, bShouldBaseAtStartup, bShouldStopKarma, bShowOctreeNodes, bSkipActorPropertyReplication, bSmoothKarmaStateUpdates, bSpecialLit, bStasis, bStatic, bStaticLighting, bSuperHighDetail, bTearOff, bTempEditor, bTicked, bTimerLoop, bTraceWater, bTrailerAllowRotation, bTrailerPrePivot, bTrailerSameRotation, bTravel, bUnlit, Buoyancy, bUpdateSimulatedPosition, bUseCollisionStaticMesh, bUseCylinderCollision, bUseDynamicLights, bUseLightingFromBase, bWasSNFiltered, bWorldGeometry, CachedLocalToWorld, CachedLocation, CachedRotation, ClientOverlayCounter, ClientOverlayTimer, CollisionHeight, CollisionRadius, CollisionTag, ColLocation, CullDistance, Deleted, DesiredRotation, DrawScale, DrawScale3D, DrawType, Event, ExcludeTag[8], FluidSurfaceShootStrengthMod, ForcedVisibilityZoneTag, ForceNoise, ForceRadius, ForceScale, ForceType, Group, HardRelMatrix, HighDetailOverlay, InitialState, Instigator, Inventory, JoinedTag, KParams, KStepTag, LastRenderTime, LatentFloat, Leaves, Level, LifeSpan, LightBrightness, LightCone, LightEffect, LightHue, LightPeriod, LightPhase, LightRadius, LightRenderData, LightSaturation, LightType, Location, LODBias, Mass, MaxLights, Mesh, MeshInstance, MessageClass, NetPriority, NetTag, NetUpdateFrequency, NetUpdateTime, OctreeBox, OctreeBoxCenter, OctreeBoxRadii, OctreeNodes, OverlayMaterial, OverlayTimer, Owner, PendingTouch, Physics, PhysicsVolume, PrePivot, Projectors, Region, RelativeLocation, RelativeRotation, RemoteRole, RenderRevision, RepSkin, Role, Rotation, RotationRate, ScaleGlow, SimAnim, Skins, SoundOcclusion, SoundPitch, SoundRadius, SoundVolume, StaticFilterState, StaticMesh, StaticMeshInstance, StaticMeshProjectors, StaticSectionBatches, Style, SurfaceType, Tag, Texture, TimerCounter, TimerRate, Touching, TransientSoundRadius, TransientSoundVolume, UV2Mode, UV2Texture, Velocity, XLevel

Enumerations Summary
EAuthMethod
AM_None, AM_Unknown, AM_Basic, AM_Digest,
ETransferMode
TM_Normal, TM_Fast,
HTTPState
HTTPState_Resolving, HTTPState_Connecting, HTTPState_SendingRequest, HTTPState_WaitingForResponse, HTTPState_ReceivingData, HTTPState_Closed,
Inherited Enumerations from Engine.Actor
EDoubleClickDir, EDrawType, EFilterState, EFlagState, EForceType, eKillZType, ELightEffect, ELightType, EMusicTransition, ENetRole, EPhysics, ERenderStyle, ESoundOcclusion, ESoundSlot, ESurfaceTypes, ETravelType, EUV2Mode

Structures Summary
RequestHistoryEntry
Method, Hostname, Location, URL, HTTPresponse
Inherited Structures from Engine.Actor
ActorRenderDataPtr, AnimRep, BatchReference, FireProperties, KRBVec, KRigidBodyState, KSimParams, LightRenderDataPtr, PointRegion, ProjectorRenderInfoPtr, StaticMeshProjectorRenderInfoPtr

Delegates Summary
delegate OnComplete (HttpSock Sender)
delegate OnConnectError (HttpSock Sender)
delegate OnConnectionTimeout (HttpSock Sender)
delegate OnError (HttpSock Sender, string ErrorMessage, optional string Param1, optional string Param2)
delegatebool OnFollowRedirect (HttpSock Sender, HttpUtil.xURL NewLocation))
delegate OnPreConnect (HttpSock Sender)
delegate OnRequestBody (HttpSock Sender)
delegate OnRequireAuthorization (HttpSock Sender, EAuthMethod method, array<GameInfo.KeyValuePair> info)
delegate OnRequireProxyAuthorization (HttpSock Sender, EAuthMethod method, array<GameInfo.KeyValuePair> info)
delegatebool OnResolved (HttpSock Sender, string hostname, InternetLink.IpAddr Addr))
delegate OnResolveFailed (HttpSock Sender, string hostname)
delegatebool OnResponseBody (HttpSock Sender, string line))
delegate OnReturnCode (HttpSock Sender, int ReturnCode, string ReturnMessage, string HttpVer)
delegate OnSendRequestHeaders (HttpSock Sender)

Functions Summary
functionbool Abort ()))
functionbool AddHeader (string hname, coerce string value, optional bool bNoReplace))
functionbool CachedResolve (coerce string hostname, optional bool bDontConnect))
functionbool clearFormData ()))
function ClearRequestData (optional bool bDontClearAuth))
function Closed ()))
function CloseSocket ()))
functionbool CreateSocket ()))
functionint DataSize (array<string> data))
event Destroyed ()))
functionstring genAuthorization (EAuthMethod method, string Username, string Password, array<GameInfo.KeyValuePair> Info))
functionstring genBasicAuthorization (string Username, string Password))
functionstring genDigestAuthorization (string Username, string Password, array<GameInfo.KeyValuePair> Info))
functionbool get (string location))
functionstring getHTTPversion ()))
functionstring GetRequestHeader (string hname, optional coerce string def))
functionstring GetReturnHeader (string hname, optional coerce string def))
functionint getTZoffset ()))
functionstring GetValue (string key, array<GameInfo.KeyValuePair> Info, optional coerce string def))
functionbool head (string location))
functionbool HttpRequest (string location, string Method))
functionbool httrace (string location))
function InternalResolved (InternetLink.IpAddr Addr, optional bool bDontCache))
functionbool IsAuthMethodSupported (EAuthMethod method))
functionbool IsSupportedMethod ()))
function Logf (coerce string message, optional int level, optional coerce string Param1, optional coerce string Param2))
functionint now ()))
functionbool OpenConnection ()))
function Opened ()))
functionbool post (string location, optional string PostData))
functionbool postex (string location, optional array<string> PostData))
event PreBeginPlay ()))
function ProccessWWWAuthenticate (string HeaderData, bool bProxyAuth))
function ProcHeaders ()))
function ProcInput (string inline))
functionstring randString (optional int size, optional coerce string prefix))
function ReceivedText (string Line ))
functionbool RemoveHeader (string hname))
function ResolveFailed ()))
function SendData (string data, optional bool bFlush))
functionbool setFormData (string field, coerce string data, optional string contentType, optional string contentEncoding))
functionbool setFormDataEx (string field, array<string> data, optional string contentType, optional string contentEncoding))
functionbool setHTTPversion (optional string newver))
functionbool ShouldFollowRedirect (int retc, string method))
functionEAuthMethod StrToAuthMethod (coerce string method))
function Timer ()))
functionstring UserAgent ()))
Inherited Functions from Engine.Info
AcceptPlayInfoProperty, AllowClassRemoval, FillPlayInfo, GetDescriptionText, GetSecurityLevel
Inherited Functions from Engine.Actor
*, +, -, AddToPackageMap, AdjustVolume, AllActors, AllowMusicPlayback, AnimBlendParams, AnimBlendToAlpha, AnimEnd, AnimIsInGroup, AnimStopLooping, Attach, AttachToBone, AutonomousPhysics, BaseChange, BasedActors, BecomeViewTarget, BeginEvent, BeginPlay, BlocksShotAt, BoneRefresh, BroadcastLocalizedMessage, Bump, CanSplash, ChangeBaseParamsFeedbackEffect, ChangeSpringFeedbackEffect, CheckForErrors, CheckMaxEffectDistance, ChildActors, ClearStayingDebugLines, ClientTrigger, Clock, CollidingActors, ConsoleCommand, CopyObjectToClipboard, Crash, CurrentLIPSincAnim, DebugClock, DebugUnclock, DemoPlaySound, Destroy, Destroyed, Detach, DetachFromBone, DisplayDebug, DrawDebugCircle, DrawDebugLine, DrawDebugSphere, DrawStayingDebugLine, DynamicActors, EffectIsRelevant, EnableChannelNotify, EncroachedBy, EncroachingOn, EndedRotation, EndEvent, Error, Falling, FastTrace, FellOutOfWorld, FinishAnim, FinishedInterpolation, FinishInterpolation, ForceFeedbackSupported, FreezeAnimAt, GainedChild, GetAllInt, GetAllIntDesc, GetAnimParams, GetBoneCoords, GetBoneRotation, GetCacheEntry, GetClosestBone, GetCollisionExtent, GetDebugName, GetHumanReadableName, GetLocalString, GetMapName, GetMeshName, GetNextInt, GetNextIntDesc, GetNextSkin, GetNotifyChannel, GetRenderBoundingSphere, GetRootLocation, GetRootLocationDelta, GetRootRotation, GetRootRotationDelta, GetSoundDuration, GetURLMap, GetUrlOption, HasAnim, HasLIPSincAnim, HealDamage, HitWall, HurtRadius, IsAnimating, IsInPain, IsInVolume, IsJoinedTo, IsPlayingLIPSincAnim, IsStationary, IsTweening, KAddAngularImpulse, KAddBoneLifter, KAddImpulse, KApplyForce, KDisableCollision, KDrawRigidBodyState, KEnableCollision, KFreezeRagdoll, KGetActorGravScale, KGetCOMOffset, KGetCOMPosition, KGetDampingProps, KGetFriction, KGetImpactThreshold, KGetInertiaTensor, KGetMass, KGetRBQuaternion, KGetRestitution, KGetRigidBodyState, KGetSimParams, KGetSkelMass, KilledBy, KImpact, KIsAwake, KIsRagdollAvailable, KMakeRagdollAvailable, KRBVecFromVector, KRBVecToVector, KRemoveAllBoneLifters, KRemoveLifterFromBone, KScaleJointLimits, KSetActorGravScale, KSetBlockKarma, KSetCOMOffset, KSetDampingProps, KSetFriction, KSetImpactThreshold, KSetInertiaTensor, KSetMass, KSetRestitution, KSetSimParams, KSetSkelVel, KSetStayUpright, KSetStayUprightParams, KSkelConvulse, KUpdateState, KVelDropBelow, KWake, Landed, LinkMesh, LinkSkelAnim, LIPSincAnimEnd, LockRootMotion, LoopAnim, LostChild, MakeNoise, MatchStarting, Move, MoveCacheEntry, MoveSmooth, NearSpot, NotifyLocalPlayerDead, NotifyLocalPlayerTeamReceived, OnlyAffectPawns, PauseStream, PawnBaseDied, PhysicsVolumeChange, PlayAnim, PlayerCanSeeMe, PlayFeedbackEffect, PlayLIPSincAnim, PlayMusic, PlayOwnedSound, PlaySound, PlayStream, PlayTeleportEffect, PostBeginPlay, PostLoadSavedGame, PostNetBeginPlay, PostNetReceive, PostTeleport, PostTouch, POVChanged, PreBeginPlay, PrecacheAnnouncer, PreSaveGame, PreTeleport, RadiusActors, RanInto, RecoverFromBadStateCode, RenderOverlays, RenderTexture, Reset, ResetStaticFilterState, SeekStream, SelfTriggered, SetAnimFrame, SetBase, SetBoneDirection, SetBoneLocation, SetBoneRotation, SetBoneScale, SetCollision, SetCollisionSize, SetDefaultDisplayProperties, SetDelayedDamageInstigatorController, SetDisplayProperties, SetDrawScale, SetDrawScale3D, SetDrawType, SetGRI, SetInitialState, SetLocation, SetOverlayMaterial, SetOwner, SetPhysics, SetRelativeLocation, SetRelativeRotation, SetRotation, SetStaticMesh, SetTimer, ShouldBeHidden, Sleep, Spawn, SpecialHandling, StartInterpolation, StopAllMusic, StopAnimating, StopFeedbackEffect, StopLIPSincAnim, StopMusic, StopStream, SuggestFallVelocity, TakeDamage, TeamLink, TextToSpeech, Tick, Timer, TimerPop, TornOff, Touch, TouchingActor, TouchingActors, Trace, TraceActors, TraceThisActor, TravelPostAccept, TravelPreAccept, Trigger, TriggerEvent, TweenAnim, UnClock, UnTouch, UnTrigger, UntriggerEvent, UpdateAnnouncements, UpdatePrecacheMaterials, UpdatePrecacheStaticMeshes, UpdateURL, UsedBy, VisibleActors, VisibleCollidingActors, ZoneChange


Constants Detail

BUFFERSIZE Source code

const BUFFERSIZE = 2048;
the output buffer size

HTTP_CONNECT Source code

const HTTP_CONNECT = "CONNECT";

HTTP_DELETE Source code

const HTTP_DELETE = "DELETE";

HTTP_GET Source code

const HTTP_GET = "GET";

HTTP_HEAD Source code

const HTTP_HEAD = "HEAD";

HTTP_OPTIONS Source code

const HTTP_OPTIONS = "OPTIONS";

HTTP_POST Source code

const HTTP_POST = "POST";

HTTP_PUT Source code

const HTTP_PUT = "PUT";

HTTP_TRACE Source code

const HTTP_TRACE = "TRACE";

VERSION Source code

const VERSION = 401;
LibHTTP version number


Variables Detail

authBasicLookup Source code

var protected array<string> authBasicLookup;
Base64 encoding lookup table

bAuthTrap Source code

var protected bool bAuthTrap;
true if an authentication retry should happen

bIsChunked Source code

var protected bool bIsChunked;
true if the data is chunked (e.g. Transfer-Encoding: chunked )

BoundPort Source code

var protected int BoundPort;
the port we are connected to

bTempProxyOverride Source code

var protected bool bTempProxyOverride;
will be set to true in case of a ...

bTimeout Source code

var protected bool bTimeout;
true in case of a connection timeout

bUseTempProxy Source code

var protected bool bUseTempProxy;
if true use the TempProxy

chunkedCounter Source code

var protected int chunkedCounter;
bytes left in the chunk

Cookies Source code

var HTTPCookies Cookies;
the cookie data instance

CRLF Source code

var protected string CRLF;
constant CR LF

CurRedir Source code

var protected int CurRedir;
current number of redirections

curState Source code

var HTTPState curState;
The current state of the socket

EXTENTION Source code

var const string EXTENTION;
If you make a custom build of this package, or subclass this class then please change the following constant to countain your "extention" name. This will be used in the UserAgent string. (Change it in the defaultproperties)

FollowingRedir Source code

var protected bool FollowingRedir;
true if a redirection should be followed

HttpCookieClass Source code

var class<HttpCookies> HttpCookieClass;
Cookie class to use (if it has not been set)

HttpLink Source code

var protected HttpLink HttpLink;
handle to the HttpLink

HttpLinkClass Source code

var protected class<HttpLink> HttpLinkClass;
the link class to use

HTTPVER Source code

var protected string HTTPVER;
The HTTP version to use. Either 1.0 or 1.1 are supported.

inBuffer Source code

var protected string inBuffer;
i/o buffers

LastStatus Source code

var int LastStatus;
The last returned HTTP status code

LocalLink Source code

var protected InternetLink.IpAddr LocalLink;
local link address

MultiPartBoundary Source code

var protected string MultiPartBoundary;
Multipart boundary string, used to split fields

outBuffer Source code

var protected string outBuffer;
i/o buffers

procHeader Source code

var protected bool procHeader;
true if headers are being processed

RequestData Source code

var array<string> RequestData;
the request data

RequestDuration Source code

var float RequestDuration;
duration of the last request

RequestHeaders Source code

var array<string> RequestHeaders;
the request headers

RequestHistory Source code

var array<RequestHistoryEntry> RequestHistory;
history with requests for a single request, will contain more then one entry

RequestMethod Source code

var string RequestMethod;
the request method

ResolveCache Source code

var protected HttpResolveCache ResolveCache;
cache object with hostname resolves

ResolveHostname Source code

var protected string ResolveHostname;
the hostname being resolved, used to add to the resolve cache

ReturnData Source code

var array<string> ReturnData;
the return data

ReturnHeaders Source code

var array<string> ReturnHeaders;
the return headers

StartRequestTime Source code

var protected float StartRequestTime;
start of the request, will be set after the connection was opened and before the actual request will be send

TempProxy Source code

var protected HttpUtil.xURL TempProxy;
temporary proxy configuration

TZoffset Source code

var protected int TZoffset;
Timezone Offset, dynamically calculated from the server's time

Utils Source code

var protected HttpUtil Utils;
utility class, used to speed up lookups (optimization)

Authentication

AuthInfo Source code

var(Authentication) array<GameInfo.KeyValuePair> AuthInfo;
authentication information

AuthMethod Source code

var(Authentication) EAuthMethod AuthMethod;
Authentication method to use when sUsername is set. This will

bAutoAuthenticate Source code

var(Authentication) bool bAutoAuthenticate;
If username and password have been set automatically retry the request to authenticate. Note: this can only be done in a second try because the

Options

bFollowRedirect Source code

var(Options) bool bFollowRedirect;
when set to false it won't follow redirects

bProcCookies Source code

var(Options) config bool bProcCookies;
Process incoming cookies, defaults to true

bRfcCompliantRedirect Source code

var(Options) bool bRfcCompliantRedirect;
responding to HTTP redirect headers is RFC compliant, otherwise it will behave much like some other HTTP clients behave. This means that in case of a 301/302 it will set the request method from POST to GET. This is not the way it should happen according to the standard.

bSendCookies Source code

var(Options) config bool bSendCookies;
Send cookie data when available, defaults to true

fConnectTimout Source code

var(Options) config float fConnectTimout;
connection timeout, if the connection couldn't be established within this time limit it will abort the connection and call OnTimeout()

iMaxRedir Source code

var(Options) config int iMaxRedir;
Maximum redirections to follow

iVerbose Source code

var(Options) config int iVerbose;
log verbosity, you probably want to leave this 0. check the [[HttpUtil]] class for various log levels.

Proxy

bUseProxy Source code

var(Proxy) globalconfig bool bUseProxy;
Use a proxy server, this is (and the other proxy settins) a client setting. It's meant for clients to be set when they need to use a proxy.

iProxyPort Source code

var(Proxy) globalconfig int iProxyPort;
The proxy port

ProxyAuthInfo Source code

var(Proxy) array<GameInfo.KeyValuePair> ProxyAuthInfo;
authentication information

ProxyAuthMethod Source code

var(Proxy) EAuthMethod ProxyAuthMethod;
Authentication method to use when sUsername is set. This will

sProxyHost Source code

var(Proxy) globalconfig string sProxyHost;
The hostname of the proxy

sProxyPass Source code

var(Proxy) globalconfig string sProxyPass;
proxy authentication information

sProxyUser Source code

var(Proxy) globalconfig string sProxyUser;
proxy authentication information

URL

CurrentURL Source code

var(URL) HttpUtil.xURL CurrentURL;
the URL struct for the current request

DefaultAccept Source code

var(URL) string DefaultAccept;
the default value for the Accept header, we only support "text / *"

iLocalPort Source code

var(URL) int iLocalPort;
the local port, leave zero to use a random port (adviced)

XferMode

iMaxBytesPerTick Source code

var(XferMode) config int iMaxBytesPerTick;
maximum number of bytes to download in a single tick

iMaxIterationsPerTick Source code

var(XferMode) config int iMaxIterationsPerTick;
Maximum iterations per tick in fast transfer mode. This defines the number of download retries (when nothing was received) the code may perform within a single tick. Because the data pending variable is only updated each tick it will remain true until the transfer function returns even tho there is no data pending.

TransferMode Source code

var(XferMode) config ETransferMode TransferMode;
Transfer mode to use during downloads


Enumerations Detail

EAuthMethod Source code

enum EAuthMethod
{
AM_None, AM_Unknown, AM_Basic, AM_Digest,
};
Possible authentication methods, Basic used Base64 encoding to encode the username and password. Digest is more secure.

ETransferMode Source code

enum ETransferMode
{
TM_Normal, TM_Fast,
};
Method used to download the data.
TM_Fast will try to read as much as possible in a single tick, this will have an impact on the game performance during the download. Only use this mode when it's time critical. Use the variables iMaxBytesPerTick and iMaxIterationsPerTick to tweak this transfer mode.

HTTPState Source code

enum HTTPState
{
HTTPState_Resolving, HTTPState_Connecting, HTTPState_SendingRequest, HTTPState_WaitingForResponse, HTTPState_ReceivingData, HTTPState_Closed,
};


Structures Detail

RequestHistoryEntry Source code

struct RequestHistoryEntry
{
var deprecated string Hostname;
var int HTTPresponse;
var deprecated string Location;
var string Method;
var HttpUtil.xURL URL;
};

Hostname:
server hostname
HTTPresponse:
the HTTP response code received
Location:
location, can include GET data
Method:
method used in the request
URL:
the request URL


Delegates Detail

OnComplete Source code

delegate OnComplete ( HttpSock Sender )
Will be called when the operation was completed successfully.
It won't be called when an time out occured.

OnConnectError Source code

delegate OnConnectError ( HttpSock Sender )
Called when Open() fails

OnConnectionTimeout Source code

delegate OnConnectionTimeout ( HttpSock Sender )
called when the connection has timed out (e.g. open() failed after a set time)

OnError Source code

delegate OnError ( HttpSock Sender, string ErrorMessage, optional string Param1, optional string Param2 )
Will be called in case of an internal error.

OnFollowRedirect Source code

delegate bool OnFollowRedirect ( HttpSock Sender, HttpUtil.xURL NewLocation) )
Called before the redirection is followed, return false to prevernt following the redirection

OnPreConnect Source code

delegate OnPreConnect ( HttpSock Sender )
Called before the connection is established.

OnRequestBody Source code

delegate OnRequestBody ( HttpSock Sender )
Will be called when the request body has to be send. Do note that you are required to set the Content-Length header to the total size of the content being send. If you use this delegate to send the request body manually you will have to set the Content-Length header yourself.

OnRequireAuthorization Source code

delegate OnRequireAuthorization ( HttpSock Sender, EAuthMethod method, array<GameInfo.KeyValuePair> info )
Will be called when authorization is required for the current location.
This will be called directly after receiving the WWW-Authenticate header. So it's best not to stall this call. It's just a notification.

OnRequireProxyAuthorization Source code

delegate OnRequireProxyAuthorization ( HttpSock Sender, EAuthMethod method, array<GameInfo.KeyValuePair> info )
Will be called when authorization is required for the current proxy.
This will be called directly after receiving the Proxy-Authenticate header. So it's best not to stall this call. It's just a notification.

OnResolved Source code

delegate bool OnResolved ( HttpSock Sender, string hostname, InternetLink.IpAddr Addr) )
Will be called when the host name is resolved.
Return true to continue, or false to abort.

OnResolveFailed Source code

delegate OnResolveFailed ( HttpSock Sender, string hostname )
Called when the resolved failed, hostname is the hostname that could not be resolved

OnResponseBody Source code

delegate bool OnResponseBody ( HttpSock Sender, string line) )
Will be called for every response line received (only the body). Return false to stop the default behavior of storing the response body. Use this delegate if you need to have live updates of the content and can not wait until the request is complete.

OnReturnCode Source code

delegate OnReturnCode ( HttpSock Sender, int ReturnCode, string ReturnMessage, string HttpVer )
Will be called when the return code has been received; This is the first function called after the request has been send.

OnSendRequestHeaders Source code

delegate OnSendRequestHeaders ( HttpSock Sender )
This delegate will be send right before the headers are send to the webserver. If you want to change the headers you should do it here.
Warning: becarefull not to change or unset automatically generated headers that are important for this request (like authentication or request body headers)


Functions Detail

Abort Source code

function bool Abort ( ) )
Abort the current request, if possible

AddHeader Source code

function bool AddHeader ( string hname, coerce string value, optional bool bNoReplace) )
Add a header, case insensitive. Set bNoReplace to false to not overwrite the old header. Returns true when the header has been set.

CachedResolve Source code

protected function bool CachedResolve ( coerce string hostname, optional bool bDontConnect) )
lookup a chached resolve and connect if found

clearFormData Source code

function bool clearFormData ( ) )
This will clear the POST data. Use this before calling setFormData

ClearRequestData Source code

function ClearRequestData ( optional bool bDontClearAuth) )
This function will clear the previous request data. You may want to use this when you do a new request with the same socket. Previous set headers won't be unset automatically.

Closed Source code

function Closed ( ) )
connection closed, check for a required redirection

CloseSocket Source code

function CloseSocket ( ) )
destroy the current socket, should only be called in case of a timeout

CreateSocket Source code

function bool CreateSocket ( ) )
create the socket, if required

DataSize Source code

function int DataSize ( array<string> data) )
Return the actual data size of a string array, it appends sizeof(CRLF) for each line. This is used for sending the RequestData.

Destroyed Source code

event Destroyed ( ) )
clean up as much as possible

genAuthorization Source code

function string genAuthorization ( EAuthMethod method, string Username, string Password, array<GameInfo.KeyValuePair> Info) )
generate the authentication data, depending on the method it will be either a Basic or Digest response

genBasicAuthorization Source code

protected function string genBasicAuthorization ( string Username, string Password) )
Generated a basic authentication response

genDigestAuthorization Source code

protected function string genDigestAuthorization ( string Username, string Password, array<GameInfo.KeyValuePair> Info) )
generate the Digest authorization data string

get Source code

function bool get ( string location) )
This will perform a simple HTTP GET request. This will be the most commonly used function to retrieve a document from a webserver. The location is just like the location you would use in your webbrowser.

getHTTPversion Source code

function string getHTTPversion ( ) )
return thr current HTTP version setting

GetRequestHeader Source code

function string GetRequestHeader ( string hname, optional coerce string def) )
Returns the value of the requested header, or default if not found

GetReturnHeader Source code

function string GetReturnHeader ( string hname, optional coerce string def) )
Returns the value of the returned header, or default if not found

getTZoffset Source code

function int getTZoffset ( ) )
Return the timezone offset

GetValue Source code

static function string GetValue ( string key, array<GameInfo.KeyValuePair> Info, optional coerce string def) )
Returns the value of a KeyValuePair

head Source code

function bool head ( string location) )
perform a HTTP HEAD request. This will only return the headers. Use this this if you only want to check the file info on the server and not the whole body.

HttpRequest Source code

protected function bool HttpRequest ( string location, string Method) )
Start the HTTP request. Location can be a fully qualified url, or just the location on the configured server.
This is an internal function called by the get(), head() and post() functions. If you want to support additional HTTP requests you should subclass this class.

httrace Source code

function bool httrace ( string location) )
perform a HTTP TRACE request. This will simply cause the webserver to return the request it received. It's only usefull for debugging.

InternalResolved Source code

function InternalResolved ( InternetLink.IpAddr Addr , optional bool bDontCache) )
hostname has been resolved

IsAuthMethodSupported Source code

static function bool IsAuthMethodSupported ( EAuthMethod method) )
return if the authentication method is supported

IsSupportedMethod Source code

protected function bool IsSupportedMethod ( ) )
Returns true when the request method is supported

Logf Source code

function Logf ( coerce string message, optional int level, optional coerce string Param1, optional coerce string Param2) )
manage logging

now Source code

function int now ( ) )
Returns the current timestamp. Warning this is not a valid UNIX timestamp because the timezone is unknown (e.g. timestamps are always GMT)

OpenConnection Source code

protected function bool OpenConnection ( ) )
start the download

Opened Source code

function Opened ( ) )
will be called from HttpLink

post Source code

function bool post ( string location, optional string PostData) )
This will perform a simple HTTP POST request. If the PostData is not empty it will overwrite the current post data and set the content type to application/x-www-form-urlencoded.

postex Source code

function bool postex ( string location, optional array<string> PostData) )
Perform a HTTP POST request using an array containing the postdata. if the array length > 0 it will overwrite the current post data. It will send the post data AS IS and doesn't set the content-type.
You might want to use the post(); function together with setFormData();, that method is easier to use.

PreBeginPlay Source code

event PreBeginPlay ( ) )
initialize some variables

ProccessWWWAuthenticate Source code

protected function ProccessWWWAuthenticate ( string HeaderData, bool bProxyAuth) )
Process the header data of a WWW-Authenticate or Proxy-Authorization header

ProcHeaders Source code

protected function ProcHeaders ( ) )
Will be called by ProcInput after all headers have been received

ProcInput Source code

protected function ProcInput ( string inline) )
Process the input

randString Source code

static function string randString ( optional int size, optional coerce string prefix) )
Generates a random string. The size defaults to 16. Prefix isn't included with the size;

ReceivedText Source code

function ReceivedText ( string Line ) )
called from HttpLink

RemoveHeader Source code

function bool RemoveHeader ( string hname) )
Remove a header, case insensitive. Returns true when the header is deleted

ResolveFailed Source code

function ResolveFailed ( ) )
will be called from HttpLink when the resolve failed

SendData Source code

protected function SendData ( string data, optional bool bFlush) )
Send data buffered
if bFlush it will flush all remaining data (should be used for the last call)

setFormData Source code

function bool setFormData ( string field, coerce string data, optional string contentType, optional string contentEncoding) )
Simple form of setFormDataEx when the data is only one line

setFormDataEx Source code

function bool setFormDataEx ( string field, array<string> data, optional string contentType, optional string contentEncoding) )
Add form data (used for multipart/form-data instead of application/x-www-form-urlencoded). This method makes it easier to add form-data. It doesn't clear the previous data, it will just append it. Form Data gives you more control over the actual data send. Also you don't have to escape the data.
It will also force the content type to multipart/form-data.

setHTTPversion Source code

function bool setHTTPversion ( optional string newver) )
Set the HTTP version, if empty the default will be used.

ShouldFollowRedirect Source code

protected function bool ShouldFollowRedirect ( int retc, string method) )
returns true when a redirect should be followed, also updates headers for the next request.

StrToAuthMethod Source code

static function EAuthMethod StrToAuthMethod ( coerce string method) )
string to EAuthMethod

Timer Source code

function Timer ( ) )
timer is used for the conenection timeout.

UserAgent Source code

function string UserAgent ( ) )
Returns the useragent string we use


Defaultproperties

defaultproperties
{
    EXTENTION=""
    iVerbose=-1
    iLocalPort=0
    bFollowRedirect=true
    bRfcCompliantRedirect=true
    curState=HTTPState_Closed
    iMaxRedir=5
    HTTPVER="1.1"
    DefaultAccept="text/*"
    bSendCookies=true
    bProcCookies=true
    bUseProxy=false
    fConnectTimout=60
    HttpLinkClass=class'HttpLink'
    HttpCookieClass=class'HttpCookies'
    TransferMode=TM_Normal
    iMaxIterationsPerTick=32
    iMaxBytesPerTick=4096
    AuthMethod=AM_None
    bAutoAuthenticate=true
}

Overview Package Class Source Class tree Glossary
previous class      next class frames      no frames
Creation time: Sa 23.8.2014 09:18:15.283 - Created with UnCodeX