1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2000, 2010 Oracle and/or its affiliates.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * This file is part of OpenOffice.org.
11 * OpenOffice.org is free software: you can redistribute it and/or modify
12 * it under the terms of the GNU Lesser General Public License version 3
13 * only, as published by the Free Software Foundation.
15 * OpenOffice.org is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU Lesser General Public License version 3 for more details
19 * (a copy is included in the LICENSE file that accompanied this code).
21 * You should have received a copy of the GNU Lesser General Public License
22 * version 3 along with OpenOffice.org. If not, see
23 * <http://www.openoffice.org/license.html>
24 * for a copy of the LGPLv3 License.
26 ************************************************************************/
27 #ifndef _COM_SUN_STAR_CONNECTION_XCONNECTION_IDL_
28 #define _COM_SUN_STAR_CONNECTION_XCONNECTION_IDL_
30 #include
<com
/sun
/star
/io
/IOException.idl
>
33 module com
{ module sun
{ module star
{ module connection
{
35 /** A bidirectional bytestream.
37 <p> You should additionally implement XConnection2.
41 published
interface XConnection
: com
::sun
::star
::uno
::XInterface
44 /** reads a requested number of bytes from the connection.
45 <p> This method is blocking, meaning that it always returns a bytesequence
46 with the requested number of bytes, unless it has reached end of file (which
47 often means, that close() has been called).
49 <p> please see also the readSomeBytes() method of XConnection2.
51 @return The read number of bytes.
52 The return value and the length of the
53 returned sequence must be identical.
55 The number of bytes to be read from the stream.
57 @throws com::sun::star::io::IOException
58 in case an error occurred during reading from the stream.
60 long read
( [out] sequence
< byte > aReadBytes
, [in] long nBytesToRead
)
61 raises
( com
::sun
::star
::io
::IOException
);
64 // DocMerge from xml: method com::sun::star::connection::XConnection::write
65 /** writes the given bytesequence to the stream.
66 <p>The method blocks until the whole sequence is written.
68 @throws com::sun::star::io::IOException
69 in case an error occurred during writing to the stream.
71 void write
( [in] sequence
< byte > aData
)
72 raises
( com
::sun
::star
::io
::IOException
);
75 /** Empties all internal buffers.
78 raises
( com
::sun
::star
::io
::IOException
);
80 /** Immediately terminates any ongoing read or write calls.
81 All subsequent read or write calls()
84 raises
( com
::sun
::star
::io
::IOException
);
87 /** A unique string describing the connection.
89 <p>This string is different from the arguments to <member>XConnection::accept</member>
90 and <member>XConnector::connect</member>. In general, the string contains an additional
91 handle value. For example, "socket,host=localhost,port=2002,uniqueValue=2324". </p>
93 string getDescription
();