FileDocCategorySizeDatePackage
Protocol.javaAPI DocphoneME MR2 API (J2ME)2960Wed May 02 18:00:16 BST 2007com.sun.midp.io.j2me.socket

Protocol

public class Protocol extends com.sun.cdc.io.j2me.socket.Protocol

Fields Summary
protected int
iStreams
Number of input streams that were opened.
protected int
maxIStreams
Maximum number of open input streams. Set this to zero to prevent openInputStream from giving out a stream in write-only mode.
Constructors Summary
Methods Summary
protected voidcheckMIDPPermission(java.lang.String host, int port)

        //The actual MIDP permission check happens here
    
public java.io.DataInputStreamopenDataInputStream()

        return new DataInputStream(openInputStream());
    
public java.io.InputStreamopenInputStream()


    /*
     * Open the input stream if it has not already been opened.
     * @exception IOException is thrown if it has already been
     * opened.
     */
         
        if (maxIStreams == 0) {
            throw new IOException("no more input streams available");
        }
        InputStream i = super.openInputStream();
        maxIStreams--;
        iStreams++;
        return i;
    
public voidsetSocketOption(byte option, int value)

        if (option == SocketConnection.SNDBUF || option == SocketConnection.RCVBUF ) {
            if (value == 0) {
                value = 1;
                super.setSocketOption(option, value);
            }
        }            
        super.setSocketOption(option, value);