⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 opennet.pas

📁 .net 方面的开发说明资料。
💻 PAS
📖 第 1 页 / 共 2 页
字号:
  // Notes  : None
  // ----------------------------------------------------------

  function EpGetVersion() : PChar; stdcall; external DLL_NAME name '_EpGetVersion@0';

  // ----------------------------------------------------------
  // Purpose: Registers a new transport
  // Usage  : Call this function to add support for a new
  //          transport in the system.
  // Notes  : Transport ids must be unique GUIDs. Use GUIDGEN
  //          to create a new GUID number.
  // ----------------------------------------------------------

  function EpRegisterTransport(id : TGUID; create : ObjectCreateProc) : Boolean; stdcall; external DLL_NAME name '_EpRegisterTransport@20';

  // ----------------------------------------------------------
  // Purpose: Registers a new protocol
  // Usage  : Call this function to add support for a new
  //          protocol in the system.
  // Notes  : Protocol ids must be unique GUIDs. Use GUIDGEN
  //          to create a new GUID number.
  // ----------------------------------------------------------

  function EpRegisterProtocol(id : TGUID; create : ObjectCreateProc) : Boolean; stdcall; external DLL_NAME name '_EpRegisterProtocol@20';

  // ----------------------------------------------------------
  // Purpose: Creates a new transport
  // Usage  : Use this function to start a communication
  //          session. The transport_type parameter specifies the
  //          type of transport to be created (rs232, tcpip, etc).
  // Notes: : None
  // ----------------------------------------------------------

  function EpCreateTransport(transport_type : TGUID; prop : PTransportProperties; callback : CallbackProc; enable_debug_events : Boolean = false; connection : PPConnection = nil; data : Pointer = nil) : TRANSPORT_HANDLE; stdcall; external DLL_NAME name '_EpCreateTransport@36';

  // ----------------------------------------------------------
  // Purpose: Destroys a previously created transport
  // Usage  : None
  // Notes  : None
  // ----------------------------------------------------------

  procedure EpDestroyTransport(transport : TRANSPORT_HANDLE); stdcall; external DLL_NAME name '_EpDestroyTransport@4';

  // ----------------------------------------------------------
  // Purpose: Enables or disables the postage of debug events
  //          for a specific transports. These events include
  //          SYSTEM_DATA_IN and SYSTEM_DATA_OUT. More events
  //          might be included in the future
  // ----------------------------------------------------------

  procedure EpEnableDebugEvents(transport : TRANSPORT_HANDLE; enable : Boolean); stdcall; external DLL_NAME name '_EpEnableDebugEvents@8';

  // ----------------------------------------------------------
  // Purpose: Sets a transport option
  // Usage  : None
  // Notes  : None
  // ----------------------------------------------------------

  function EpGetOption(transport : TRANSPORT_HANDLE; option : integer; value : Pointer) : Boolean; stdcall; external DLL_NAME name '_EpGetOption@12';

  // ----------------------------------------------------------
  // Purpose: Sets a transport option
  // Usage  : None
  // Notes  : None
  // ----------------------------------------------------------

  function EpSetOption(transport : TRANSPORT_HANDLE; option : integer; value : Pointer; size : Integer) : Boolean; stdcall; external DLL_NAME name '_EpSetOption@16';

  // ----------------------------------------------------------
  // Purpose: Adds a protocol to a transport
  // Usage  : None
  // Notes  : None
  // ----------------------------------------------------------

  function EpAddProtocol(transport : TRANSPORT_HANDLE; id : TGUID) : Boolean; stdcall; external DLL_NAME name '_EpAddProtocol@20';

  // ----------------------------------------------------------
  // Purpose: Removes a protocol from a transport
  // Usage  : None
  // Notes  : None
  // ----------------------------------------------------------

  function EpRemoveProtocol(transport : TRANSPORT_HANDLE; id : TGUID) : Boolean; stdcall; external DLL_NAME name '_EpRemoveProtocol@20';

  // ----------------------------------------------------------
  // Purpose: Resets a protocol
  // Usage  : None
  // Notes  : None
  // ----------------------------------------------------------

  function EpResetProtocol(transport : TRANSPORT_HANDLE; id : TGUID) : Boolean; stdcall; external DLL_NAME name '_EpResetProtocol@20';

  // ----------------------------------------------------------
  // Purpose: Pushes a session onto a transport
  // Usage  : None
  // Notes  : None
  // ----------------------------------------------------------

  function EpPushSession(transport : TRANSPORT_HANDLE; id : ISession; monitor : PConnection = nil; connect : PPConnection = nil) : Boolean; stdcall; external DLL_NAME name '_EpPushSession@16';

  // ----------------------------------------------------------
  // Purpose: Pops a session from a transport
  // Usage  : None
  // Notes  : None
  // ----------------------------------------------------------

  function EpPopSession(transport : TRANSPORT_HANDLE) : Boolean; stdcall; external DLL_NAME name '_EpPopSession@4';

  // ----------------------------------------------------------
  // Purpose: Resets all protocols in a session
  // Usage  : None
  // Notes  : None
  // ----------------------------------------------------------

  function EpResetSession(transport : TRANSPORT_HANDLE; id : ISession) : Boolean; stdcall; external DLL_NAME name '_EpResetSession@8';

  // ----------------------------------------------------------
  // Purpose: Connects to an external source
  // Usage  : Use this function to connect a transport to
  //          an external host, such as a modem or an internet
  //          service.
  // Notes  : Each transport-type has its own way, non compatible
  //          way of plugging into external servers. However,
  //          OpenNet tries to unify them by sending an
  //          internal event SYSTEM_CONNECTED when a connection
  //          was successfulor SYSTEM_CONNECTION_FAILED when the
  //          connection couldn't be made.
  // ----------------------------------------------------------

  procedure EpConnect(transport : TRANSPORT_HANDLE; host : PChar; port, timeout : Integer); stdcall; external DLL_NAME name '_EpConnect@16';

  // ----------------------------------------------------------
  // Purpose: Disconnects from an external source
  // Usage  : Use this function to disconnect a transport from an
  //          external host, such as a modem or an internet
  //          service.
  // Notes  : Each transport-type has its own, non compatible
  //          way of plugging to external sources. However,
  //          OpenNet tries to unify them by sending an
  //          internal event SYSTEM_DISCONNECTED when a connection
  //          was successfully aborted. If a connection could not me
  //          aborted SYSTEM_DISCONNECTION_FAILED is sent. Any
  //          internal events for the specific transport-type are
  //          also sent.
  // ----------------------------------------------------------

  procedure EpDisconnect(transport : TRANSPORT_HANDLE); stdcall; external DLL_NAME name '_EpDisconnect@4';

  // ----------------------------------------------------------
  // Purpose: Sends an event to a transport
  // Usage  : Whenever you want to send some data to a transport
  //          you have to create an event for it. The transport
  //          accepts the event, transforms it to data for
  //          the target device via a protocol router, and then
  //          sends the data to the target device. When data
  //          is received, the data is once again lead through
  //          the protocol and transformed to an EpEvent. Then
  //          the event is sent to the Grid's callback function.
  // Notes  : The event data is sent to the protocol, transformed,
  //          and immediately sent to the transport, When this function
  // ----------------------------------------------------------

  function EpSendAction(transport : TRANSPORT_HANDLE; action : PEpAction) : Boolean; stdcall; external DLL_NAME name '_EpSendAction@8';

  // ----------------------------------------------------------
  // Purpose: Dispatches an EpEvent to the grid callback
  // Usage  : This function is probably only of use in
  //          protocols. It takes a EpEvent, and sends it
  //          to a grid's callback function. The user can
  //          then do something according to the EpEvent he
  //          received.
  // Notes  : The event data is copied and stored in a queue.
  //          You may immediately clean up the event after
  //          this function returns.
  // Notes  : When the user handled the dispatched message,
  //          he must call EpHandledEvent to notify OpenNet that
  //          the event data can be destroyed.
  // Notes  : If the size member in the event is larger than 0,
  //          the data member is ignored.
  // ----------------------------------------------------------

  procedure EpDispatchEvent(transport : TRANSPORT_HANDLE; event : PEpEvent); stdcall; external DLL_NAME name '_EpDispatchEvent@8';

  // ----------------------------------------------------------
  // Purpose: Sends transformed data from the protocol to the
  //          transport
  // Usage  : This function initiates the actual data transfer
  //          in the transport. You should only use this
  //          function in a protocol implementation.
  // Notes  : The sent data is copied inside the transport, to
  //          ensure reliable communication. When this function
  //          returns, you can immediately delete the data.
  // Notes  : If the protocol member in the EpEvent is nonzero,
  //          then the data in the data member is send through
  //          a assigned protocol object. The protocol then calls
  //          EpCompleteEvent to send the actual (translated) data.
  //          If the protocol member is zero, OpenNet sees the
  //          data in the data member as raw data and sends
  //          immediately.
  // ----------------------------------------------------------

  procedure EpCompleteAction(transport : TRANSPORT_HANDLE; data : PByte; size : Integer); stdcall; external DLL_NAME name '_EpCompleteAction@12';

  // ----------------------------------------------------------
  // Purpose: Sends raw data to a transport
  // Usage  : This is a convenient wrapper to directly
  //          pass raw data to a transport, without creating a
  //          EpEvent. Normally you would create a EpEvent
  //          with the protocol member set to 0.
  // Notes  : Because there is no protocol attached to raw
  //          data, you may decide what kind of event you
  //          want to see in return. If the reply_protocol
  //          parameter is 0, the reply event will be a
  //          system event. Otherwise it will be an event
  //          of the protocol assigned to the transport on creation.
  // ----------------------------------------------------------

  function EpSendRawData(transport : TRANSPORT_HANDLE; data : PByte; size : Integer; reply_protocol : TGUID; reply_msg, timeout : Integer) : Boolean; stdcall; external DLL_NAME name '_EpSendRawData@36';

  // ----------------------------------------------------------
  // Purpose: Notifies OpenNet that a reply arrived for an event.
  // Usage  : When an event is sent with a positive value time-
  //          out, OpenNet will send an SYSTEM_TIMEOUT event
  //          when the given time has elapsed. When this function
  //          is called, the timeout event is supressed.
  // Notes  : When there were sent multiple events with the same
  //          type, EpHandledEvent removes them in the order they
  //          were sent, regardless of differences in the time-out
  //          values.
  // ----------------------------------------------------------

  function EpCancelTimeout(transport : TRANSPORT_HANDLE; protocol : TGUID; msg : Integer) : Boolean; stdcall; external DLL_NAME name '_EpCancelTimeout@24';

  // ----------------------------------------------------------
  // Purpose: Retrieves some extra reference data from an event
  // Usage  : A transport might store some extra reference data
  //          when it posts an event. For example an UDP
  //          transport stores the ip address of the user that
  //          sent the packet.
  // Notes  : None
  // ----------------------------------------------------------

  function EpGetEventRefData(transport : TRANSPORT_HANDLE; reference : Integer) : Pointer; stdcall; external DLL_NAME name '_EpGetEventRefData@8';

  // ----------------------------------------------------------
  // Purpose: Sends unidentified data to the previous protocol
  //          in the inheritance chain.
  // Usage  : Whenever a protocol finds data it can't handle,
  //          it can send it to the previous protocol in the
  //          inheritance chain and ultimately to a built
  //          in protocol for a particular transport (the
  //          'system' protocol)
  // ----------------------------------------------------------

  procedure EpInheritedRecv(transport : TRANSPORT_HANDLE; data : PByte; size : Integer); stdcall; external DLL_NAME name '_EpInheritedRecv@12';

  // ----------------------------------------------------------
  // Purpose: Retrieves a protocol interface from a GUID
  // Usage  : None
  // ----------------------------------------------------------

  function EpGetProtocolName(transport : TRANSPORT_HANDLE; protocol : TGuid; name : PChar; size : Integer) : Integer; stdcall; external DLL_NAME name '_EpGetProtocolName@28';

  // ----------------------------------------------------------
  // Purpose: Retrieves a protocol interface from a GUID
  // Usage  : None
  // ----------------------------------------------------------

  function EpGetProtocolMsgName(transport : TRANSPORT_HANDLE; protocol : TGuid; msg : Integer; name : PChar; size : Integer) : Integer; stdcall; external DLL_NAME name '_EpGetProtocolMsgName@32';

implementation

end.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -