# Class MCPLoopbackSocketTransport.Connection

java.lang.Object
com.codename1.io.SocketConnection
com.codename1.mcp.MCPLoopbackSocketTransport.Connection

Enclosing class:
  `MCPLoopbackSocketTransport`

public static final class MCPLoopbackSocketTransport.Connection extends SocketConnection
The per-connection callback the socket API instantiates. Public with a no-argument constructor because `Socket.listenLoopback(int, Class)` creates it reflectively.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `Connection()`
  Public and no-argument because `Socket.listenLoopback(int, Class)` constructs this reflectively; the binding above is what the constructor exists for.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `connectionError(int errorCode, String message)`
  Invoked in case of an error in the socket connection, this method is invoked off the EDT
  `void`
  `connectionEstablished(InputStream is, OutputStream os)`
  Invoked when a socket connection is established, this method is invoked off the EDT

  ### Methods inherited from class SocketConnection

  `getConnectTimeout, isConnected, setConnectTimeout`

  ### Methods inherited from class Object

  `clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### Connection

    public Connection()
    Public and no-argument because `Socket.listenLoopback(int, Class)` constructs this reflectively; the binding above is what the constructor exists for.

- ## Method Details

  - ### connectionError

    public void connectionError(int errorCode, String message)
    Description copied from class: `SocketConnection`

    Invoked in case of an error in the socket connection, this method is invoked off the EDT

    ###### Parameters

    - `errorCode`: the error code

    - `message`: error message if applicable

    Specified by:
      `connectionError` in class `SocketConnection`

  - ### connectionEstablished

    public void connectionEstablished(InputStream is, OutputStream os)
    Description copied from class: `SocketConnection`

    Invoked when a socket connection is established, this method is invoked off the EDT

    ###### Parameters

    - `is`: input stream for the socket

    - `os`: output stream for the socket

    Specified by:
      `connectionEstablished` in class `SocketConnection`