summaryrefslogtreecommitdiff
path: root/csharp/src/Ice/Transceiver.cs
blob: 01cf7b7c45f051395f468e57374685038cb1811c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
// **********************************************************************
//
// Copyright (c) 2003-present ZeroC, Inc. All rights reserved.
//
// This copy of Ice is licensed to you under the terms described in the
// ICE_LICENSE file included in this distribution.
//
// **********************************************************************

namespace IceInternal
{
    using System.Net.Sockets;

    public interface Transceiver
    {
        Socket fd();
        int initialize(Buffer readBuffer, Buffer writeBuffer, ref bool hasMoreData);
        int closing(bool initiator, Ice.LocalException ex);
        void close();
        void destroy();

        EndpointI bind();
        int write(Buffer buf);
        int read(Buffer buf, ref bool hasMoreData);

        //
        // Read data asynchronously.
        //
        // The I/O request may complete synchronously, in which case finishRead
        // will be invoked in the same thread as startRead. The caller must check
        // the buffer after finishRead completes to determine whether all of the
        // requested data has been read.
        //
        // The read request is canceled upon the termination of the thread that
        // calls startRead, or when the socket is closed. In this case finishRead
        // raises ReadAbortedException.
        //
        bool startRead(Buffer buf, AsyncCallback callback, object state);
        void finishRead(Buffer buf);

        //
        // Write data asynchronously.
        //
        // The I/O request may complete synchronously, in which case finishWrite
        // will be invoked in the same thread as startWrite. The request
        // will be canceled upon the termination of the thread that calls startWrite.
        //
        bool startWrite(Buffer buf, AsyncCallback callback, object state, out bool completed);
        void finishWrite(Buffer buf);

        string protocol();
        string toDetailedString();
        Ice.ConnectionInfo getInfo();
        void checkSendSize(Buffer buf);
        void setBufferSize(int rcvSize, int sndSize);
    }

}