1 //
2 // Copyright (c) ZeroC, Inc. All rights reserved.
3 //
4 
5 namespace IceInternal
6 {
7     using System.Net.Sockets;
8 
9     public interface Transceiver
10     {
fd()11         Socket fd();
initialize(Buffer readBuffer, Buffer writeBuffer, ref bool hasMoreData)12         int initialize(Buffer readBuffer, Buffer writeBuffer, ref bool hasMoreData);
closing(bool initiator, Ice.LocalException ex)13         int closing(bool initiator, Ice.LocalException ex);
close()14         void close();
destroy()15         void destroy();
16 
bind()17         EndpointI bind();
write(Buffer buf)18         int write(Buffer buf);
read(Buffer buf, ref bool hasMoreData)19         int read(Buffer buf, ref bool hasMoreData);
20 
21         //
22         // Read data asynchronously.
23         //
24         // The I/O request may complete synchronously, in which case finishRead
25         // will be invoked in the same thread as startRead. The caller must check
26         // the buffer after finishRead completes to determine whether all of the
27         // requested data has been read.
28         //
29         // The read request is canceled upon the termination of the thread that
30         // calls startRead, or when the socket is closed. In this case finishRead
31         // raises ReadAbortedException.
32         //
startRead(Buffer buf, AsyncCallback callback, object state)33         bool startRead(Buffer buf, AsyncCallback callback, object state);
finishRead(Buffer buf)34         void finishRead(Buffer buf);
35 
36         //
37         // Write data asynchronously.
38         //
39         // The I/O request may complete synchronously, in which case finishWrite
40         // will be invoked in the same thread as startWrite. The request
41         // will be canceled upon the termination of the thread that calls startWrite.
42         //
startWrite(Buffer buf, AsyncCallback callback, object state, out bool completed)43         bool startWrite(Buffer buf, AsyncCallback callback, object state, out bool completed);
finishWrite(Buffer buf)44         void finishWrite(Buffer buf);
45 
protocol()46         string protocol();
toDetailedString()47         string toDetailedString();
getInfo()48         Ice.ConnectionInfo getInfo();
checkSendSize(Buffer buf)49         void checkSendSize(Buffer buf);
setBufferSize(int rcvSize, int sndSize)50         void setBufferSize(int rcvSize, int sndSize);
51     }
52 
53 }
54