Java Doc for Protocol.java in  » 6.0-JDK-Modules » j2me » com » sun » cdc » io » j2me » socket » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » 6.0 JDK Modules » j2me » com.sun.cdc.io.j2me.socket 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   java.io.OutputStream
      java.io.DataOutputStream
         com.sun.cdc.io.GeneralBase
            com.sun.cdc.io.ConnectionBase
               com.sun.cdc.io.j2me.socket.Protocol

All known Subclasses:   com.sun.midp.io.j2me.socket.Protocol,
Protocol
public class Protocol extends ConnectionBase implements StreamConnection,SocketConnection(Code)
GenericStreamConnection to the J2SE socket API.
author:
   Nik Shaylor
version:
   1.0 10/08/99


Field Summary
 booleanipv6
    
 intopens
    
 Socketsocket
    


Method Summary
protected  voidcheckMIDPPermission(String host, int port)
    
public  voidclose()
     Close the connection.
public  StringgetAddress()
     Gets the remote address to which the socket is bound.
public  StringgetLocalAddress()
     Gets the local address to which the socket is bound.
public  intgetLocalPort()
     Returns the local port to which this socket is bound.
public  intgetPort()
     Returns the remote port to which this socket is bound.
public  intgetSocketOption(byte option)
     Get a socket option for the connection.
public  voidopen(String name, int mode, boolean timeouts)
    
public  voidopen(Socket socket)
    
public  InputStreamopenInputStream()
     Returns an input stream for this socket.
public  OutputStreamopenOutputStream()
     Returns an output stream for this socket.
public  ConnectionopenPrim(String name, int mode, boolean timeouts)
    
public  voidsetSocketOption(byte option, int value)
     Set a socket option for the connection.

Options inform the low level networking code about intended usage patterns that the application will use in dealing with the socket connection.

Calling setSocketOption to assign buffer sizes is a hint to the platform of the sizes to set the underlying network I/O buffers. Calling getSocketOption can be used to see what sizes the system is using. The system MAY adjust the buffer sizes to account for better throughput available from Maximum Transmission Unit (MTU) and Maximum Segment Size (MSS) data available from current network information.


Parameters:
  option - socket option identifier (KEEPALIVE, LINGER,SNDBUF, RCVBUF, or DELAY)
Parameters:
  value - numeric value for specified option
exception:
  IllegalArgumentException - if the value is notvalid (e.g.

Field Detail
ipv6
boolean ipv6(Code)
IPv6 address



opens
int opens(Code)
Open count



socket
Socket socket(Code)
Socket object





Method Detail
checkMIDPPermission
protected void checkMIDPPermission(String host, int port)(Code)



close
public void close() throws IOException(Code)
Close the connection.
exception:
  IOException - if an I/O error occurs when closing theconnection.



getAddress
public String getAddress() throws IOException(Code)
Gets the remote address to which the socket is bound. The address can be either the remote host name or the IP address(if available). the remote address to which the socket is bound.
exception:
  IOException - if the connection was closed.



getLocalAddress
public String getLocalAddress() throws IOException(Code)
Gets the local address to which the socket is bound.

The host address(IP number) that can be used to connect to this end of the socket connection from an external system. Since IP addresses may be dynamically assigned, a remote application will need to be robust in the face of IP number reassignment.

The local hostname (if available) can be accessed from System.getProperty("microedition.hostname")

the local address to which the socket is bound.
exception:
  IOException - if the connection was closed.
See Also:   ServerSocketConnection



getLocalPort
public int getLocalPort() throws IOException(Code)
Returns the local port to which this socket is bound. the local port number to which this socket is connected.
exception:
  IOException - if the connection was closed.
See Also:   ServerSocketConnection



getPort
public int getPort() throws IOException(Code)
Returns the remote port to which this socket is bound. the remote port number to which this socket is connected.
exception:
  IOException - if the connection was closed.



getSocketOption
public int getSocketOption(byte option) throws IllegalArgumentException, IOException(Code)
Get a socket option for the connection.
Parameters:
  option - socket option identifier (KEEPALIVE, LINGER,SNDBUF, RCVBUF, or DELAY) numeric value for specified option or -1 if thevalue is not available.
exception:
  IllegalArgumentException - if the option identifier isnot valid
exception:
  IOException - if the connection was closed
See Also:   Protocol.setSocketOption



open
public void open(String name, int mode, boolean timeouts) throws IOException(Code)
Open the connection



open
public void open(Socket socket) throws IOException(Code)
Open the connection
Parameters:
  socket - an already formed socket

This function is only used by com.sun.kjava.system.palm.protocol.socketserver;




openInputStream
public InputStream openInputStream() throws IOException(Code)
Returns an input stream for this socket. an input stream for reading bytes from this socket.
exception:
  IOException - if an I/O error occurs when creating theinput stream.



openOutputStream
public OutputStream openOutputStream() throws IOException(Code)
Returns an output stream for this socket. an output stream for writing bytes to this socket.
exception:
  IOException - if an I/O error occurs when creating theoutput stream.



openPrim
public Connection openPrim(String name, int mode, boolean timeouts) throws IOException(Code)
Open the connection
Parameters:
  name - the target for the connection
Parameters:
  writeable - a flag that is true if the caller expects to write to theconnection.
Parameters:
  timeouts - A flag to indicate that the called wants timeout exceptions

The name string for this protocol should be:":




setSocketOption
public void setSocketOption(byte option, int value) throws IllegalArgumentException, IOException(Code)
Set a socket option for the connection.

Options inform the low level networking code about intended usage patterns that the application will use in dealing with the socket connection.

Calling setSocketOption to assign buffer sizes is a hint to the platform of the sizes to set the underlying network I/O buffers. Calling getSocketOption can be used to see what sizes the system is using. The system MAY adjust the buffer sizes to account for better throughput available from Maximum Transmission Unit (MTU) and Maximum Segment Size (MSS) data available from current network information.


Parameters:
  option - socket option identifier (KEEPALIVE, LINGER,SNDBUF, RCVBUF, or DELAY)
Parameters:
  value - numeric value for specified option
exception:
  IllegalArgumentException - if the value is notvalid (e.g. negative value) or if the optionidentifier is not valid
exception:
  IOException - if the connection was closed
See Also:   Protocol.getSocketOption



Methods inherited from com.sun.cdc.io.ConnectionBase
abstract public void open(String name, int mode, boolean timeouts) throws IOException(Code)(Java Doc)
public DataInputStream openDataInputStream() throws IOException(Code)(Java Doc)
public DataOutputStream openDataOutputStream() throws IOException(Code)(Java Doc)
public InputStream openInputStream() throws IOException(Code)(Java Doc)
public OutputStream openOutputStream() throws IOException(Code)(Java Doc)
public Connection openPrim(String name, int mode, boolean timeouts) throws IOException(Code)(Java Doc)

Methods inherited from com.sun.cdc.io.GeneralBase
public void close() throws IOException(Code)(Java Doc)
public void flush() throws IOException(Code)(Java Doc)
public int read() throws IOException(Code)(Java Doc)
public boolean readBoolean() throws IOException(Code)(Java Doc)
public byte readByte() throws IOException(Code)(Java Doc)
public char readChar() throws IOException(Code)(Java Doc)
public double readDouble() throws IOException(Code)(Java Doc)
public float readFloat() throws IOException(Code)(Java Doc)
public void readFully(byte b) throws IOException(Code)(Java Doc)
public void readFully(byte b, int off, int len) throws IOException(Code)(Java Doc)
public int readInt() throws IOException(Code)(Java Doc)
public String readLine() throws IOException(Code)(Java Doc)
public long readLong() throws IOException(Code)(Java Doc)
public short readShort() throws IOException(Code)(Java Doc)
public String readUTF() throws IOException(Code)(Java Doc)
public int readUnsignedByte() throws IOException(Code)(Java Doc)
public int readUnsignedShort() throws IOException(Code)(Java Doc)
public long skip(long n) throws IOException(Code)(Java Doc)
public int skipBytes(int n) throws IOException(Code)(Java Doc)
public void write(int b) throws IOException(Code)(Java Doc)
public void write(byte b, int off, int len) throws IOException(Code)(Java Doc)

Fields inherited from java.io.DataOutputStream
protected OutputStream out(Code)(Java Doc)

Methods inherited from java.io.DataOutputStream
public void close() throws IOException(Code)(Java Doc)
public void flush() throws IOException(Code)(Java Doc)
public void write(int b) throws IOException(Code)(Java Doc)
public void write(byte b, int off, int len) throws IOException(Code)(Java Doc)
final public void writeBoolean(boolean v) throws IOException(Code)(Java Doc)
final public void writeByte(int v) throws IOException(Code)(Java Doc)
final public void writeChar(int v) throws IOException(Code)(Java Doc)
final public void writeChars(String s) throws IOException(Code)(Java Doc)
final public void writeDouble(double v) throws IOException(Code)(Java Doc)
final public void writeFloat(float v) throws IOException(Code)(Java Doc)
final public void writeInt(int v) throws IOException(Code)(Java Doc)
final public void writeLong(long v) throws IOException(Code)(Java Doc)
final public void writeShort(int v) throws IOException(Code)(Java Doc)
final public void writeUTF(String str) throws IOException(Code)(Java Doc)

Methods inherited from java.io.OutputStream
public void close() throws IOException(Code)(Java Doc)
public void flush() throws IOException(Code)(Java Doc)
abstract public void write(int b) throws IOException(Code)(Java Doc)
public void write(byte b) throws IOException(Code)(Java Doc)
public void write(byte b, int off, int len) throws IOException(Code)(Java Doc)

Methods inherited from java.lang.Object
public boolean equals(Object obj)(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.