1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
21 module com
{ module sun
{ module star
{ module connection
{
23 /** A bidirectional bytestream.
25 <p> You should additionally implement XConnection2.
29 published
interface XConnection
: com
::sun
::star
::uno
::XInterface
32 /** reads a requested number of bytes from the connection.
33 <p> This method is blocking, meaning that it always returns a bytesequence
34 with the requested number of bytes, unless it has reached end of file (which
35 often means, that close() has been called).
37 <p> please see also the readSomeBytes() method of XConnection2.
39 @return The read number of bytes.
40 The return value and the length of the
41 returned sequence must be identical.
43 The buffer to receive the read bytes.
45 The number of bytes to be read from the stream.
47 @throws com::sun::star::io::IOException
48 in case an error occurred during reading from the stream.
50 long read
( [out] sequence
< byte > aReadBytes
, [in] long nBytesToRead
)
51 raises
( com
::sun
::star
::io
::IOException
);
53 /** writes the given bytesequence to the stream.
54 <p>The method blocks until the whole sequence is written.
56 @throws com::sun::star::io::IOException
57 in case an error occurred during writing to the stream.
59 void write
( [in] sequence
< byte > aData
)
60 raises
( com
::sun
::star
::io
::IOException
);
63 /** Empties all internal buffers.
66 raises
( com
::sun
::star
::io
::IOException
);
68 /** Immediately terminates any ongoing read or write calls.
69 All subsequent read or write calls()
72 raises
( com
::sun
::star
::io
::IOException
);
75 /** A unique string describing the connection.
77 <p>This string is different from the arguments to XConnection::accept()
78 and XConnector::connect(). In general, the string contains an additional
79 handle value. For example, "socket,host=localhost,port=2002,uniqueValue=2324". </p>
81 string getDescription
();
86 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */