com.intel.bluetooth.gcf.socket
Class SocketConnection

java.lang.Object
  extended by com.intel.bluetooth.gcf.socket.SocketConnection
All Implemented Interfaces:
Connection, InputConnection, OutputConnection, SocketConnection, StreamConnection

public class SocketConnection
extends Object
implements SocketConnection

Rating red

Field Summary
protected  Socket socket
           
 
Fields inherited from interface javax.microedition.io.SocketConnection
DELAY, KEEPALIVE, LINGER, RCVBUF, SNDBUF
 
Constructor Summary
SocketConnection()
           
SocketConnection(Socket socket)
           
SocketConnection(String host, int port)
           
 
Method Summary
 void close()
           
 String getAddress()
           
 String getLocalAddress()
           
 int getLocalPort()
           
 int getPort()
           
 int getSocketOption(byte option)
           
 DataInputStream openDataInputStream()
          Open and return a data input stream for a connection.
 DataOutputStream openDataOutputStream()
          Open and return a data output stream for a connection.
 InputStream openInputStream()
          Open and return an input stream for a connection.
 OutputStream openOutputStream()
          Open and return an output stream for a connection.
 void setSocketOption(byte option, int value)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

socket

protected Socket socket
Constructor Detail

SocketConnection

public SocketConnection()

SocketConnection

public SocketConnection(String host,
                        int port)
                 throws IOException
Throws:
IOException

SocketConnection

public SocketConnection(Socket socket)
Method Detail

getAddress

public String getAddress()
                  throws IOException
Specified by:
getAddress in interface SocketConnection
Throws:
IOException

getLocalAddress

public String getLocalAddress()
                       throws IOException
Specified by:
getLocalAddress in interface SocketConnection
Throws:
IOException

getLocalPort

public int getLocalPort()
                 throws IOException
Specified by:
getLocalPort in interface SocketConnection
Throws:
IOException

getPort

public int getPort()
            throws IOException
Specified by:
getPort in interface SocketConnection
Throws:
IOException

getSocketOption

public int getSocketOption(byte option)
                    throws IllegalArgumentException,
                           IOException
Specified by:
getSocketOption in interface SocketConnection
Throws:
IllegalArgumentException
IOException

setSocketOption

public void setSocketOption(byte option,
                            int value)
                     throws IllegalArgumentException,
                            IOException
Specified by:
setSocketOption in interface SocketConnection
Throws:
IllegalArgumentException
IOException

close

public void close()
           throws IOException
Specified by:
close in interface Connection
Throws:
IOException

openInputStream

public InputStream openInputStream()
                            throws IOException
Description copied from interface: InputConnection
Open and return an input stream for a connection.

Specified by:
openInputStream in interface InputConnection
Returns:
An input stream
Throws:
IOException - If an I/O error occur

openDataInputStream

public DataInputStream openDataInputStream()
                                    throws IOException
Description copied from interface: InputConnection
Open and return a data input stream for a connection.

Specified by:
openDataInputStream in interface InputConnection
Returns:
An input stream
Throws:
IOException - If an I/O error occur

openOutputStream

public OutputStream openOutputStream()
                              throws IOException
Description copied from interface: OutputConnection
Open and return an output stream for a connection.

Specified by:
openOutputStream in interface OutputConnection
Returns:
An output stream
Throws:
IOException - If an I/O error occur

openDataOutputStream

public DataOutputStream openDataOutputStream()
                                      throws IOException
Description copied from interface: OutputConnection
Open and return a data output stream for a connection.

Specified by:
openDataOutputStream in interface OutputConnection
Returns:
An output stream
Throws:
IOException - If an I/O error occur