Package java.net

Examples of java.net.SocketException


     *
     * @throws SocketException
     */
    public synchronized void appListen() throws SocketException {
        if (!isState(TCPS_CLOSED)) {
            throw new SocketException("Invalid connection state " + getStateName());
        }
        setState(TCPS_LISTEN);
    }
View Full Code Here


     *
     * @throws SocketException
     */
    public synchronized void appConnect(IPv4Address fAddr, int fPort) throws SocketException {
        if (!isState(TCPS_CLOSED)) {
            throw new SocketException("Invalid connection state " + getStateName());
        }
        super.connect(getLocalAddress(), fAddr, fPort);
        for (int attempt = 0; attempt < TCP_MAXCONNECT; attempt++) {
            try {
                // Send the SYN
View Full Code Here

                    break;
                case TCPS_CLOSED:
                    // Ignore
                    break;
                default:
                    throw new SocketException("Illegal state in close (" + getStateName() + ')');
            }
        } catch (TimeoutException ex) {
            throw (SocketException) new SocketException("Timeout").initCause(ex);
        }
        if (isReset()) {
            throw new SocketException("Connection reset");
        }
    }
View Full Code Here

    public void appSendData(byte[] data, int offset, int length) throws SocketException {
        if (DEBUG) {
            log.debug("appSendData(data, " + offset + ", " + length + ')');
        }
        if (!isState(TCPS_ESTABLISHED) && !isState(TCPS_CLOSE_WAIT)) {
            throw new SocketException("Illegal state to send data: " + getStateName());
        }
        if (offset < 0) {
            throw new IllegalArgumentException("offset " + offset);
        }
        if (length < 0) {
View Full Code Here

                return controlBlock.getSendBufferSize();
            case SocketOptions.SO_TIMEOUT:
                // todo implement it, 0 means disabled
                return 0;
            default:
                throw new SocketException("Option " + option_id +
                    " is not recognised or not implemented");
        }
    }
View Full Code Here

            } catch (InterruptedException ex) {
                // Ignore
            }
        }
        if (controlBlock.isReset()) {
            throw new SocketException("Connection reset");
        } else if (isEOF()) {
            return -1;
        } else {
            return dataBuffer.read(dst, off, len);
        }
View Full Code Here

    /**
     * @see org.jnode.net.TransportLayer#getDatagramSocketImplFactory()
     */
    public DatagramSocketImplFactory getDatagramSocketImplFactory() throws SocketException {
        throw new SocketException("TCP is socket based");
    }
View Full Code Here

        throw new IOException("Not implemented");
    }


    public static boolean connect(int fd, byte[] addr, int port, int timeout) throws SocketException {
        throw new SocketException("Not implemented");
    }
View Full Code Here

    public static boolean connect(int fd, byte[] addr, int port, int timeout) throws SocketException {
        throw new SocketException("Not implemented");
    }

    public static boolean connect6(int fd, byte[] addr, int port, int timeout) throws SocketException {
        throw new SocketException("Not implemented");
    }
View Full Code Here

            sourceHardwareAddress = new EthernetAddress(skbuf, 8);
            sourceProtocolAddress = new IPv4Address(skbuf, 14);
            destinationHardwareAddress = new EthernetAddress(skbuf, 18);
            destinationProtocolAddress = new IPv4Address(skbuf, 24);
        } else {
            throw new SocketException("Unknown hw,ptype: " + hardwareType + ',' + protocolType);
        }
    }
View Full Code Here

TOP

Related Classes of java.net.SocketException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.