01: //Copyright 02/28/01 Sun Microsystems, Inc. All Rights Reserved.
02:
03: //#pragma ident "@(#)SRAPServerSocket.java 1.3 01/02/28 Sun Microsystems"
04:
05: package com.sun.portal.util;
06:
07: import java.io.BufferedInputStream;
08: import java.io.IOException;
09: import java.io.InputStream;
10: import java.net.InetAddress;
11: import java.net.ServerSocket;
12: import java.net.Socket;
13:
14: public class SRAPServerSocket extends ServerSocket {
15: public SRAPServerSocket() throws IOException {
16: this (0);
17: }
18:
19: public SRAPServerSocket(int port) throws IOException {
20: super (port);
21: }
22:
23: public SRAPServerSocket(int port, int backlog) throws IOException {
24: super (port, backlog);
25: }
26:
27: public SRAPServerSocket(int port, int backlog, InetAddress bindAddr)
28: throws IOException {
29: super (port, backlog, bindAddr);
30: }
31:
32: public Socket accept() throws IOException {
33: IPSSocket socket = new IPSSocket();
34: implAccept(socket);
35: return socket;
36: }
37:
38: private class IPSSocket extends Socket {
39: private BufferedInputStream in;
40:
41: public IPSSocket() throws IOException {
42: super ();
43: }
44:
45: public InputStream getInputStream() throws IOException {
46: if (in == null) {
47: in = new BufferedInputStream(super.getInputStream());
48: }
49: return in;
50: }
51: }
52: }
|