Search in sources :

Example 1 with PlainSocketImpl

use of java.net.PlainSocketImpl in project j2objc by google.

the class SocketChannelImpl method socket.

/*
     * Getting the internal Socket If we have not the socket, we create a new
     * one.
     */
@Override
public synchronized Socket socket() {
    if (socket == null) {
        try {
            InetAddress addr = null;
            int port = 0;
            if (connectAddress != null) {
                addr = connectAddress.getAddress();
                port = connectAddress.getPort();
            }
            socket = new SocketAdapter(new PlainSocketImpl(fd, localPort, addr, port), this);
        } catch (SocketException e) {
            return null;
        }
    }
    return socket;
}
Also used : SocketException(java.net.SocketException) InetAddress(java.net.InetAddress) PlainSocketImpl(java.net.PlainSocketImpl)

Example 2 with PlainSocketImpl

use of java.net.PlainSocketImpl in project XobotOS by xamarin.

the class SocketChannelImpl method socket.

/*
     * Getting the internal Socket If we have not the socket, we create a new
     * one.
     */
@Override
public synchronized Socket socket() {
    if (socket == null) {
        try {
            InetAddress addr = null;
            int port = 0;
            if (connectAddress != null) {
                addr = connectAddress.getAddress();
                port = connectAddress.getPort();
            }
            socket = new SocketAdapter(new PlainSocketImpl(fd, localPort, addr, port), this);
        } catch (SocketException e) {
            return null;
        }
    }
    return socket;
}
Also used : SocketException(java.net.SocketException) InetAddress(java.net.InetAddress) PlainSocketImpl(java.net.PlainSocketImpl)

Example 3 with PlainSocketImpl

use of java.net.PlainSocketImpl in project robovm by robovm.

the class SocketChannelImpl method socket.

/*
     * Getting the internal Socket If we have not the socket, we create a new
     * one.
     */
@Override
public synchronized Socket socket() {
    if (socket == null) {
        try {
            InetAddress addr = null;
            int port = 0;
            if (connectAddress != null) {
                addr = connectAddress.getAddress();
                port = connectAddress.getPort();
            }
            socket = new SocketAdapter(new PlainSocketImpl(fd, localPort, addr, port), this);
        } catch (SocketException e) {
            return null;
        }
    }
    return socket;
}
Also used : SocketException(java.net.SocketException) InetAddress(java.net.InetAddress) PlainSocketImpl(java.net.PlainSocketImpl)

Aggregations

InetAddress (java.net.InetAddress)3 PlainSocketImpl (java.net.PlainSocketImpl)3 SocketException (java.net.SocketException)3