01: /*
02: * Copyright (c) xsocket.org, 2006 - 2008. All rights reserved.
03: *
04: * This library is free software; you can redistribute it and/or
05: * modify it under the terms of the GNU Lesser General Public
06: * License as published by the Free Software Foundation; either
07: * version 2.1 of the License, or (at your option) any later version.
08: *
09: * This library is distributed in the hope that it will be useful,
10: * but WITHOUT ANY WARRANTY; without even the implied warranty of
11: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12: * Lesser General Public License for more details.
13: *
14: * You should have received a copy of the GNU Lesser General Public
15: * License along with this library; if not, write to the Free Software
16: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17: *
18: * Please refer to the LGPL license at: http://www.gnu.org/copyleft/lesser.txt
19: * The latest copy of this software may be found on http://www.xsocket.org/
20: */
21: package org.xsocket.connection.spi;
22:
23: import java.io.IOException;
24: import java.net.InetSocketAddress;
25: import java.util.Map;
26:
27: import org.xsocket.connection.IConnection;
28:
29: /**
30: * Client IO Provider, which is responsible to create and manage client-side {@link IIoHandler} <br><br>
31: *
32: *
33: * @author grro@xsocket.org
34: */
35: public interface IClientIoProvider extends IHandlerIoProvider {
36:
37: public static final String PROVIDER_CLASSNAME_KEY = "org.xsocket.stream.io.ClientIoProviderClass";
38:
39: public static final String SO_SNDBUF = IConnection.SO_SNDBUF;
40: public static final String SO_RCVBUF = IConnection.SO_RCVBUF;
41: public static final String SO_REUSEADDR = IConnection.SO_REUSEADDR;
42: public static final String SO_TIMEOUT = "SOL_SOCKET.SO_TIMEOUT";
43: public static final String SO_KEEPALIVE = IConnection.SO_KEEPALIVE;
44: public static final String SO_LINGER = IConnection.SO_LINGER;
45: public static final String TCP_NODELAY = IConnection.TCP_NODELAY;
46:
47: public static final long DEFAULT_CONNECTION_TIMEOUT_MILLIS = IConnection.DEFAULT_CONNECTION_TIMEOUT_MILLIS;
48: public static final long DEFAULT_IDLE_TIMEOUT_MILLIS = IConnection.DEFAULT_IDLE_TIMEOUT_MILLIS;
49:
50: /**
51: * Return the version of this implementation. It consists of any string assigned
52: * by the vendor of this implementation and does not have any particular syntax
53: * specified or expected by the Java runtime. It may be compared for equality
54: * with other package version strings used for this implementation
55: * by this vendor for this package.
56: *
57: * @return the version of the implementation
58: */
59: public String getImplementationVersion();
60:
61: /**
62: * creates a client-site {@link IIoHandler}
63: *
64: * @param remoteAddress the remote address
65: * @param options the socket options
66: * @return the new IoHandler-instance
67: * @throws IOException If some other I/O error occurs
68: *
69: */
70: public IIoHandler createClientIoHandler(
71: InetSocketAddress remoteAddress, int connectTimeoutMillis,
72: Map<String, Object> options) throws IOException;
73: }
|