Discuss this help topic in MsgConnect Forum

Filter: C++  Pascal  C#  VB.NET  Java  Java ME  ActiveX  DLL 



InetTransport.OnDisconnected

InetTransport     See also    


This event is used to notify the application that a connection with given peer has been closed.

Declaration

[C++]
    typedef void (STDCALLCONV *MCSocketDisconnectedEvent)(void* UserData, void* Sender, MCSocketDir Direction, char* RemoteHost, unsigned short RemotePort);
    void setOnDisconnected(MCSocketDisconnectedEvent Value, void * UserData = NULL);
    MCSocketDisconnectedEvent getOnDisconnected(void * *UserData);

[Pascal]
    property OnDisconnected: TMCSocketDisconnectedEvent;
    TMCSocketDisconnectedEvent = procedure (Sender : TObject; Direction : TMCSocketDir; RemoteHost : string; RemotePort : word) of object;

[VB6]
    Private Sub IMCXInetTransportEvents.OnDisconnected(ByVal Direction As MCXControl.MCXSocketDir, ByVal RemoteHost As String, ByVal RemotePort As Long)

[ActiveX]
    void IMCXInetTransportEvents.OnDisconnected( [in] MCXSocketDir Direction, [in] BSTR RemoteHost, [in] long RemotePort);

[C#]
    public MCSocketDisconnectedEvent OnDisconnected;
    public delegate void MCSocketDisconnectedEvent(object Sender, MCSocketDisconnectedEventArgs Args);
    public class MCSocketDisconnectedEventArgs : EventArgs
    {
        public MCSocketDir Direction,
        public string RemoteHost,
        public int RemotePort
    }

[VB.NET]
    Public Event OnDisconnected As MCSocketDisconnectedEvent
    Public Delegate Sub MCSocketDisconnectedEvent(ByVal Sender As Object, ByVal Args As MCSocketDisconnectedEventArgs)
    Public Class MCSocketDisconnectedEventArgs
        Public Direction As MCSocketDir
        Public RemoteHost As String
        Public RemotePort As Integer
    End Class

[Java]
    public class MCSocketDisconnectedEvent {
        public int getDirection();
        public String getRemoteHost();
        public int getRemotePort();
    }
    public abstract interface MCSocketDisconnectedListener {
        public void socketDisconnected(MCSocketDisconnectedEvent e);
    }
    public void removeSocketDisconnectedListener(MCSocketDisconnectedListener l);
    public void addSocketDisconnectedListener(MCSocketDisconnectedListener l);

[Java ME]
    public class MCSocketDisconnectedEvent {
        public int getDirection();
        public String getRemoteHost();
        public int getRemotePort();
    }
    public abstract interface MCSocketDisconnectedListener {
        public void socketDisconnected(MCSocketDisconnectedEvent e);
    }
    public void removeSocketDisconnectedListener(MCSocketDisconnectedListener l);
    public void addSocketDisconnectedListener(MCSocketDisconnectedListener l);

[DLL]
    not implemented;

Parameters

  • UserData - application-defined data that is passed back to the callback function.
  • Direction - specifies whether the connected sockets was initiating or accepting connection
  • RemoteHost - contains IP address of remote socket
  • RemotePort - contains port number of the remote socket

Description

    This event is used to notify the application that SocketTransport or HTTPTransport has closed connection with remote host. The event is fired only if the connection was actually established and a handshake (for SocketTransport) was successful. Note, that if the application sets AllowConnection parameter of OnConnected event to false, OnDisconnected event is fired anyway.

    NOTE: The event is fired in context of transport (worker) thread (not messenger thread).

See also:     OnConnected    

Discuss this help topic in MsgConnect Forum