Java Doc for SocketImpl.java in  » Apache-Harmony-Java-SE » java-package » java » net » 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 » Apache Harmony Java SE » java package » java.net 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   java.net.SocketImpl

SocketImpl
abstract public class SocketImpl implements SocketOptions(Code)
The abstract superclass of all classes that implement streaming sockets. Streaming sockets are wrapped by two classes, ServerSocket and Socket at the server and client end of a connection respectively. At the server there are two types of sockets engaged in communication, the ServerSocket on a well known port (hereafter referred to as the listener) used to establish a connection and the resulting Socket (hereafter referred to as host). Some of the SocketImpl instance variable values must be interpreted in the context of the wrapper. See the getter methods for these details.


Field Summary
protected  InetAddressaddress
    
protected  FileDescriptorfd
    
protected  intlocalport
    
 INetworkSystemnetImpl
    
protected  intport
    
 intreceiveTimeout
    
 booleanshutdownInput
    
 booleanstreaming
    

Constructor Summary
public  SocketImpl()
     Construct a connection-oriented SocketImpl.

Method Summary
abstract protected  voidaccept(SocketImpl newSocket)
     Accepts a connection on the provided socket.
abstract protected  intavailable()
     Answer the number of bytes that may be read from this socket without blocking.
abstract protected  voidbind(InetAddress address, int port)
     Binds this socket to the specified local host/port.
abstract protected  voidclose()
     Close the socket.
abstract protected  voidconnect(String host, int port)
     Connects this socket to the specified remote host/port.
abstract protected  voidconnect(InetAddress address, int port)
     Connects this socket to the specified remote host address/port.
abstract protected  voidconnect(SocketAddress remoteAddr, int timeout)
     Connect the socket to the host/port specified by the SocketAddress with a specified timeout.
abstract protected  voidcreate(boolean isStreaming)
     Creates a new unconnected socket.
protected  FileDescriptorgetFileDescriptor()
     Answer the socket's file descriptor.
protected  InetAddressgetInetAddress()
     Answer the socket's address.
abstract protected  InputStreamgetInputStream()
     Answer the socket input stream.
protected  intgetLocalPort()
     Answer the socket's localport.
abstract public  ObjectgetOption(int optID)
     Answer the nominated socket option.
abstract protected  OutputStreamgetOutputStream()
     Answer the socket output stream.
protected  intgetPort()
     Answer the socket's remote port.
abstract protected  voidlisten(int backlog)
     Listen for connection requests on this stream socket.
abstract protected  voidsendUrgentData(int value)
     Send the single byte of urgent data on the socket.
abstract public  voidsetOption(int optID, Object val)
     Set the nominated socket option.
protected  voidsetPerformancePreferences(int connectionTime, int latency, int bandwidth)
     Sets performance preference for connectionTime, latency and bandwidth.
protected  voidshutdownInput()
     Shutdown the input portion of the socket. The default implementation always throws an IOException to indicate that the subclass should have overridden this method.
throws:
  IOException - Always.
protected  voidshutdownOutput()
     Shutdown the output portion of the socket. The default implementation always throws an IOException to indicate that the subclass should have overridden this method.
throws:
  IOException - Always.
protected  booleansupportsUrgentData()
     Answer if the socket supports urgent data.
public  StringtoString()
     Answers a string containing a concise, human-readable description of the socket.
 intwrite(byte[] buffer, int offset, int count)
     In the IP stack, write at most count bytes on the socket from the buffer, from the offset.

Field Detail
address
protected InetAddress address(Code)



fd
protected FileDescriptor fd(Code)



localport
protected int localport(Code)



netImpl
INetworkSystem netImpl(Code)



port
protected int port(Code)



receiveTimeout
int receiveTimeout(Code)



shutdownInput
boolean shutdownInput(Code)



streaming
boolean streaming(Code)




Constructor Detail
SocketImpl
public SocketImpl()(Code)
Construct a connection-oriented SocketImpl.
See Also:   SocketImplFactory




Method Detail
accept
abstract protected void accept(SocketImpl newSocket) throws IOException(Code)
Accepts a connection on the provided socket.
Parameters:
  newSocket - the socket to accept connections on
exception:
  SocketException - if an error occurs while accepting



available
abstract protected int available() throws IOException(Code)
Answer the number of bytes that may be read from this socket without blocking. This call does not block. the number of bytes that may be read without blocking
exception:
  SocketException - if an error occurs while peeking



bind
abstract protected void bind(InetAddress address, int port) throws IOException(Code)
Binds this socket to the specified local host/port.
Parameters:
  address - the local machine address to bind the socket to
Parameters:
  port - the port on the local machine to bind the socket to
exception:
  IOException - if an error occurs while binding



close
abstract protected void close() throws IOException(Code)
Close the socket. Usage thereafter is invalid.
exception:
  IOException - if an error occurs while closing



connect
abstract protected void connect(String host, int port) throws IOException(Code)
Connects this socket to the specified remote host/port.
Parameters:
  host - the remote host to connect to
Parameters:
  port - the remote port to connect to
exception:
  IOException - if an error occurs while connecting



connect
abstract protected void connect(InetAddress address, int port) throws IOException(Code)
Connects this socket to the specified remote host address/port.
Parameters:
  address - the remote host address to connect to
Parameters:
  port - the remote port to connect to
exception:
  IOException - if an error occurs while connecting



connect
abstract protected void connect(SocketAddress remoteAddr, int timeout) throws IOException(Code)
Connect the socket to the host/port specified by the SocketAddress with a specified timeout.
Parameters:
  remoteAddr - the remote machine address and port to connect to
Parameters:
  timeout - the millisecond timeout value, the connect will blockindefinitely for a zero value.
exception:
  IOException - if a problem occurs during the connect



create
abstract protected void create(boolean isStreaming) throws IOException(Code)
Creates a new unconnected socket. If streaming is true, create a stream socket, else a datagram socket.
Parameters:
  isStreaming - true, if the socket is type streaming
exception:
  SocketException - if an error occurs while creating the socket



getFileDescriptor
protected FileDescriptor getFileDescriptor()(Code)
Answer the socket's file descriptor. FileDescriptor the socket FileDescriptor



getInetAddress
protected InetAddress getInetAddress()(Code)
Answer the socket's address. Referring to the class comment: Listener: The local machines IP address to which this socket is bound. Host: The client machine, to which this socket is connected. Client: The host machine, to which this socket is connected. InetAddress the socket address



getInputStream
abstract protected InputStream getInputStream() throws IOException(Code)
Answer the socket input stream. InputStream an InputStream on the socket
exception:
  IOException - thrown if an error occurs while accessing the stream



getLocalPort
protected int getLocalPort()(Code)
Answer the socket's localport. The field is initialized to -1 and upon demand will go to the IP stack to get the bound value. See the class comment for the context of the local port. the socket localport



getOption
abstract public Object getOption(int optID) throws SocketException(Code)
Answer the nominated socket option.
Parameters:
  optID - the socket option to retrieve Object the option value
exception:
  SocketException - thrown if an error occurs while accessing the option



getOutputStream
abstract protected OutputStream getOutputStream() throws IOException(Code)
Answer the socket output stream. OutputStream an OutputStream on the socket
exception:
  IOException - thrown if an error occurs while accessing the stream



getPort
protected int getPort()(Code)
Answer the socket's remote port. This value is not meaningful when the socketImpl is wrapped by a ServerSocket. the remote port the socket is connected to



listen
abstract protected void listen(int backlog) throws IOException(Code)
Listen for connection requests on this stream socket. Incoming connection requests are queued, up to the limit nominated by backlog. Additional requests are rejected. listen() may only be invoked on stream sockets.
Parameters:
  backlog - the max number of outstanding connection requests
exception:
  IOException - thrown if an error occurs while listening



sendUrgentData
abstract protected void sendUrgentData(int value) throws IOException(Code)
Send the single byte of urgent data on the socket.
Parameters:
  value - the byte of urgent data
exception:
  IOException - when an error occurs sending urgent data



setOption
abstract public void setOption(int optID, Object val) throws SocketException(Code)
Set the nominated socket option.
Parameters:
  optID - the socket option to set
Parameters:
  val - the option value
exception:
  SocketException - thrown if an error occurs while setting the option



setPerformancePreferences
protected void setPerformancePreferences(int connectionTime, int latency, int bandwidth)(Code)
Sets performance preference for connectionTime, latency and bandwidth. Does nothing by default.
Parameters:
  connectionTime - the importance of connect time
Parameters:
  latency - the importance of latency
Parameters:
  bandwidth - the importance of bandwidth



shutdownInput
protected void shutdownInput() throws IOException(Code)
Shutdown the input portion of the socket. The default implementation always throws an IOException to indicate that the subclass should have overridden this method.
throws:
  IOException - Always. Designed to be subclassed.



shutdownOutput
protected void shutdownOutput() throws IOException(Code)
Shutdown the output portion of the socket. The default implementation always throws an IOException to indicate that the subclass should have overridden this method.
throws:
  IOException - Always. Designed to be subclassed.



supportsUrgentData
protected boolean supportsUrgentData()(Code)
Answer if the socket supports urgent data. Subclasses should override this method. false, subclasses must override



toString
public String toString()(Code)
Answers a string containing a concise, human-readable description of the socket. the description



write
int write(byte[] buffer, int offset, int count) throws IOException(Code)
In the IP stack, write at most count bytes on the socket from the buffer, from the offset.
Parameters:
  buffer - the buffer to read into
Parameters:
  offset - the offset into the buffer
Parameters:
  count - the number of bytes to write the actual number of bytes written
exception:
  IOException - thrown if an error occurs while writing



Methods inherited from java.lang.Object
protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object object)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final public Class<? extends Object> getClass()(Code)(Java Doc)
public int hashCode()(Code)(Java Doc)
final public void notify()(Code)(Java Doc)
final public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final public void wait(long millis, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait(long millis) 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.