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



InetTransport.OnConnected

InetTransport     See also    


This event is used to notify the application that a connection with given peer is available.

Declaration

[C++]
    typedef void (STDCALLCONV *IPCSocketConnectedEvent)(void* UserData, void* Sender, IPCSocketDir Direction, char* RemoteHost, unsigned short RemotePort, bool& AllowConnection);
    void setOnConnected(IPCSocketConnectedEvent Value, void * UserData = NULL);
    IPCSocketConnectedEvent getOnConnected(void * *UserData);

[Pascal]
    property OnConnected: TIPCSocketConnectedEvent;
    TIPCSocketConnectedEvent = procedure (Sender : TObject; Direction : TIPCSocketDir; RemoteHost : string; RemotePort : word; AllowConnection : boolean) of object;

[VB6]
    Private Sub IIPCXInetTransportEvents.OnConnected(ByVal Direction As IPCXControl.IPCXSocketDir, ByVal RemoteHost As String, ByVal RemotePort As Long)

[ActiveX]
    void IIPCXInetTransportEvents.OnConnected( [in] IPCXSocketDir Direction, [in] BSTR RemoteHost, [in] long RemotePort, [out] VARIANT_BOOL* AllowConnection);

[C#]
    public IPCSocketConnectedEvent OnConnected;
    public delegate void IPCSocketConnectedEvent(object Sender, IPCSocketConnectedEventArgs Args);
    public class IPCSocketConnectedEventArgs : EventArgs
    {
        public IPCSocketDir Direction,
        public string RemoteHost,
        public int RemotePort,
        public bool AllowConnection;
    }

[VB.NET]
    Public Event OnConnected As IPCSocketConnectedEvent
    Public Delegate Sub IPCSocketConnectedEvent(ByVal Sender As Object, ByVal Args As IPCSocketConnectedEventArgs)
    Public Class IPCSocketConnectedEventArgs
        Public Direction As IPCSocketDir
        Public RemoteHost As String
        Public RemotePort As Integer
        Public AllowConnection As Boolean
    End Class

[Java]
    public class IPCSocketConnectedEvent {
        public int getDirection();
        public String getRemoteHost();
        public int getRemotePort();
        public boolean getAllowConnection();
        public void setAllowConnection(boolean value);
    }
    public abstract interface IPCSocketConnectedListener {
        void socketConnected(IPCSocketConnectedEvent e);
    }
    public void removeSocketConnectedListener(IPCSocketConnectedListener l);
    public void addSocketConnectedListener(IPCSocketConnectedListener l);

[Java ME]
    public class IPCSocketConnectedEvent {
        public int getDirection();
        public String getRemoteHost();
        public int getRemotePort();
        public boolean getAllowConnection();
        public void setAllowConnection(boolean value);
    }
    public abstract interface IPCSocketConnectedListener {
        void socketConnected(IPCSocketConnectedEvent e);
    }
    public void removeSocketConnectedListener(IPCSocketConnectedListener l);
    public void addSocketConnectedListener(IPCSocketConnectedListener 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
  • AllowConnection - Set this parameter to false to force disconnection of the socket

Description

    This event is used to notify the application that SocketTransport or HTTPTransport has established connection with remote host. The application may prevent further message exchange by setting AllowConnection parameter to false.

    The event is fired after handshake (for SocketTransport) is done.

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

See also:     OnDisconnected