home *** CD-ROM | disk | FTP | other *** search
/ Game Level Design / GLDesign.bin / Software / UnrealEngine2Runtime / UE2Runtime-22262001_Demo.exe / IpDrv / Classes / UdpLink.uc < prev   
Text File  |  2003-10-22  |  2KB  |  58 lines

  1. //=============================================================================
  2. // UdpLink: An Internet UDP connectionless socket.
  3. //=============================================================================
  4. class UdpLink extends InternetLink
  5.     native
  6.     transient;
  7.  
  8. cpptext
  9. {
  10.     AUdpLink();
  11.     void PostScriptDestroyed();
  12.     UBOOL Tick( FLOAT DeltaTime, enum ELevelTick TickType );    
  13.     FSocketData GetSocketData();
  14. }
  15.  
  16. //-----------------------------------------------------------------------------
  17. // Variables.
  18.  
  19. var() const int BroadcastAddr;
  20.  
  21. //-----------------------------------------------------------------------------
  22. // Natives.
  23.  
  24. // BindPort: Binds a free port or optional port specified in argument one.
  25. native function int BindPort( optional int Port, optional bool bUseNextAvailable );
  26.  
  27. // SendText: Sends text string.  
  28. // Appends a cr/lf if LinkMode=MODE_Line .
  29. native function bool SendText( IpAddr Addr, coerce string Str );
  30.  
  31. // SendBinary: Send data as a byte array.
  32. native function bool SendBinary( IpAddr Addr, int Count, byte B[255] );
  33.  
  34. // ReadText: Reads text string.
  35. // Returns number of bytes read.  
  36. native function int ReadText( out IpAddr Addr, out string Str );
  37.  
  38. // ReadBinary: Read data as a byte array.
  39. native function int ReadBinary( out IpAddr Addr, int Count, out byte B[255] );
  40.  
  41. //-----------------------------------------------------------------------------
  42. // Events.
  43.  
  44. // ReceivedText: Called when data is received and connection mode is MODE_Text.
  45. event ReceivedText( IpAddr Addr, string Text );
  46.  
  47. // ReceivedLine: Called when data is received and connection mode is MODE_Line.
  48. event ReceivedLine( IpAddr Addr, string Line );
  49.  
  50. // ReceivedBinary: Called when data is received and connection mode is MODE_Binary.
  51. event ReceivedBinary( IpAddr Addr, int Count, byte B[255] );
  52.  
  53. defaultproperties
  54. {
  55.      bAlwaysTick=True
  56.      BroadcastAddr=-1;
  57. }
  58.