C# Class RemObjects.InternetPack.Connection

Inheritance: Stream, IDisposable, IConnectionTimeouts
Show file Open project: remobjects/internetpack Class Usage Examples

Public Properties

Property Type Description
CRLF Byte[]
LF Byte[]

Public Methods

Method Description
BeginConnect ( EndPoint endPoint, AsyncCallback callback, Object state ) : IAsyncResult
BeginConnect ( IPAddress address, Int32 port, AsyncCallback callback, Object state ) : IAsyncResult
BeginRead ( Byte buffer, Int32 offset, Int32 count, AsyncCallback callback, Object state ) : IAsyncResult
BeginReadLine ( AsyncCallback callback, Object state ) : IAsyncResult
BeginWrite ( Byte buffer, Int32 offset, Int32 count, AsyncCallback callback, Object state ) : IAsyncResult
BufferReadLine ( ) : String
Close ( ) : void
Connect ( EndPoint endPoint ) : void
Connect ( IPAddress address, Int32 port ) : void
Connection ( Binding binding ) : System
Connection ( Socket socket ) : System
Disconnect ( ) : void
Dispose ( ) : void
EndConnect ( IAsyncResult ar ) : void
EndRead ( IAsyncResult ar ) : Int32
EndReadLine ( IAsyncResult ar ) : String
EndWrite ( IAsyncResult ar ) : void
Flush ( ) : void
Init ( Socket socket ) : void
Read ( Byte buffer, Int32 offset, Int32 size ) : Int32
ReadLine ( ) : String
Receive ( Byte buffer ) : Int32
Receive ( Byte buffer, Int32 offset, Int32 size ) : Int32
ReceiveAllRemaining ( ) : Byte[]

Get data from connection until all bytes have been read (i.e., until Receive() returns 0). Uses a constant buffersize.

ReceiveAllRemaining ( Int32 bufferSize ) : Byte[]

Get data from connection until all bytes have been read (i.e., until Receive() returns 0). Uses a buffersize passed as a parameter.

ReceiveToStream ( Stream stream ) : void
ReceiveToStream ( Stream stream, System.Int64 size ) : void
ReceiveToStream ( Stream stream, System.Int64 size, Int32 bufferSize ) : void
ReceiveWhatsAvailable ( Byte buffer, Int32 offset, Int32 size ) : Int32
ResetStatistics ( ) : void
Seek ( System.Int64 offset, SeekOrigin origin ) : System.Int64
Send ( Byte buffer ) : Int32
Send ( Byte buffer, Int32 offset, Int32 size ) : Int32
SendFromStream ( Stream stream ) : void
SendFromStream ( Stream stream, System.Int64 size ) : void
SendFromStream ( Stream stream, System.Int64 size, Int32 bufferSize ) : void
SetLength ( System.Int64 length ) : void
SkipBytes ( Int32 size ) : void
ToString ( ) : String
Write ( Byte buffer, Int32 offset, Int32 size ) : void
WriteLine ( String line ) : void
WriteLineLF ( String line ) : void

Protected Methods

Method Description
BeginInitializeServerConnection ( AsyncCallback callback, Object state ) : IAsyncResult
DataSocketClose ( ) : void
DataSocketClose ( System.Boolean dispose ) : void
DataSocketConnect ( EndPoint endPoint ) : void
DataSocketReceiveWhatsAvaiable ( Byte buffer, Int32 offset, Int32 size ) : Int32
DataSocketSend ( Byte buffer ) : Int32
DataSocketSendAsMuchAsPossible ( Byte buffer, Int32 offset, Int32 size ) : Int32
EndInitializeServerConnection ( IAsyncResult ar ) : void
InitializeServerConnection ( ) : void
IntBeginRead ( Byte buffer, Int32 offset, Int32 count, AsyncCallback callback, Object state ) : IAsyncResult
IntBeginWrite ( Byte buffer, Int32 offset, Int32 count, AsyncCallback callback, Object state ) : IAsyncResult
IntEndRead ( IAsyncResult ar ) : Int32
IntEndWrite ( IAsyncResult ar ) : void
StartTimeoutTimer ( ) : void
StopTimeoutTimer ( ) : void
TriggerAsyncDisconnect ( ) : void
TriggerAsyncHaveIncompleteData ( ) : void
TriggerOnBytesReceived ( System.Int64 count ) : void
TriggerOnBytesSent ( System.Int64 count ) : void

Private Methods

Method Description
Abort ( ) : void
DataSocketReceive ( Byte buffer, Int32 offset, Int32 size ) : Int32
DataSocketSend ( Byte buffer, Int32 offset, Int32 size ) : Int32
Init ( Binding binding ) : void
IntReadCallback ( IAsyncResult ar ) : void
IntReadLineCallback ( IAsyncResult ar ) : void
Receive ( Byte buffer, Int32 offset, Int32 size, System.Boolean block ) : Int32
SetDefaultValues ( ) : void
TimeoutElapsed ( Object sender ) : void

Method Details

BeginConnect() public method

public BeginConnect ( EndPoint endPoint, AsyncCallback callback, Object state ) : IAsyncResult
endPoint System.Net.EndPoint
callback AsyncCallback
state Object
return IAsyncResult

BeginConnect() public method

public BeginConnect ( IPAddress address, Int32 port, AsyncCallback callback, Object state ) : IAsyncResult
address System.Net.IPAddress
port System.Int32
callback AsyncCallback
state Object
return IAsyncResult

BeginInitializeServerConnection() protected method

protected BeginInitializeServerConnection ( AsyncCallback callback, Object state ) : IAsyncResult
callback AsyncCallback
state Object
return IAsyncResult

BeginRead() public method

public BeginRead ( Byte buffer, Int32 offset, Int32 count, AsyncCallback callback, Object state ) : IAsyncResult
buffer Byte
offset System.Int32
count System.Int32
callback AsyncCallback
state Object
return IAsyncResult

BeginReadLine() public method

public BeginReadLine ( AsyncCallback callback, Object state ) : IAsyncResult
callback AsyncCallback
state Object
return IAsyncResult

BeginWrite() public method

public BeginWrite ( Byte buffer, Int32 offset, Int32 count, AsyncCallback callback, Object state ) : IAsyncResult
buffer Byte
offset System.Int32
count System.Int32
callback AsyncCallback
state Object
return IAsyncResult

BufferReadLine() public method

public BufferReadLine ( ) : String
return String

Close() public method

public Close ( ) : void
return void

Connect() public method

public Connect ( EndPoint endPoint ) : void
endPoint System.Net.EndPoint
return void

Connect() public method

public Connect ( IPAddress address, Int32 port ) : void
address System.Net.IPAddress
port System.Int32
return void

Connection() public method

public Connection ( Binding binding ) : System
binding Binding
return System

Connection() public method

public Connection ( Socket socket ) : System
socket Socket
return System

DataSocketClose() protected method

protected DataSocketClose ( ) : void
return void

DataSocketClose() protected method

protected DataSocketClose ( System.Boolean dispose ) : void
dispose System.Boolean
return void

DataSocketConnect() protected method

protected DataSocketConnect ( EndPoint endPoint ) : void
endPoint System.Net.EndPoint
return void

DataSocketReceiveWhatsAvaiable() protected method

protected DataSocketReceiveWhatsAvaiable ( Byte buffer, Int32 offset, Int32 size ) : Int32
buffer Byte
offset System.Int32
size System.Int32
return System.Int32

DataSocketSend() protected method

protected DataSocketSend ( Byte buffer ) : Int32
buffer Byte
return System.Int32

DataSocketSendAsMuchAsPossible() protected method

protected DataSocketSendAsMuchAsPossible ( Byte buffer, Int32 offset, Int32 size ) : Int32
buffer Byte
offset System.Int32
size System.Int32
return System.Int32

Disconnect() public method

public Disconnect ( ) : void
return void

Dispose() public method

public Dispose ( ) : void
return void

EndConnect() public method

public EndConnect ( IAsyncResult ar ) : void
ar IAsyncResult
return void

EndInitializeServerConnection() protected method

protected EndInitializeServerConnection ( IAsyncResult ar ) : void
ar IAsyncResult
return void

EndRead() public method

public EndRead ( IAsyncResult ar ) : Int32
ar IAsyncResult
return System.Int32

EndReadLine() public method

public EndReadLine ( IAsyncResult ar ) : String
ar IAsyncResult
return String

EndWrite() public method

public EndWrite ( IAsyncResult ar ) : void
ar IAsyncResult
return void

Flush() public method

public Flush ( ) : void
return void

Init() public method

public Init ( Socket socket ) : void
socket Socket
return void

InitializeServerConnection() protected method

protected InitializeServerConnection ( ) : void
return void

IntBeginRead() protected method

protected IntBeginRead ( Byte buffer, Int32 offset, Int32 count, AsyncCallback callback, Object state ) : IAsyncResult
buffer Byte
offset System.Int32
count System.Int32
callback AsyncCallback
state Object
return IAsyncResult

IntBeginWrite() protected method

protected IntBeginWrite ( Byte buffer, Int32 offset, Int32 count, AsyncCallback callback, Object state ) : IAsyncResult
buffer Byte
offset System.Int32
count System.Int32
callback AsyncCallback
state Object
return IAsyncResult

IntEndRead() protected method

protected IntEndRead ( IAsyncResult ar ) : Int32
ar IAsyncResult
return System.Int32

IntEndWrite() protected method

protected IntEndWrite ( IAsyncResult ar ) : void
ar IAsyncResult
return void

Read() public method

public Read ( Byte buffer, Int32 offset, Int32 size ) : Int32
buffer Byte
offset System.Int32
size System.Int32
return System.Int32

ReadLine() public method

public ReadLine ( ) : String
return String

Receive() public method

public Receive ( Byte buffer ) : Int32
buffer Byte
return System.Int32

Receive() public method

public Receive ( Byte buffer, Int32 offset, Int32 size ) : Int32
buffer Byte
offset System.Int32
size System.Int32
return System.Int32

ReceiveAllRemaining() public method

Get data from connection until all bytes have been read (i.e., until Receive() returns 0). Uses a constant buffersize.
public ReceiveAllRemaining ( ) : Byte[]
return Byte[]

ReceiveAllRemaining() public method

Get data from connection until all bytes have been read (i.e., until Receive() returns 0). Uses a buffersize passed as a parameter.
public ReceiveAllRemaining ( Int32 bufferSize ) : Byte[]
bufferSize System.Int32 Size of receive buffer used for each pass
return Byte[]

ReceiveToStream() public method

public ReceiveToStream ( Stream stream ) : void
stream Stream
return void

ReceiveToStream() public method

public ReceiveToStream ( Stream stream, System.Int64 size ) : void
stream Stream
size System.Int64
return void

ReceiveToStream() public method

public ReceiveToStream ( Stream stream, System.Int64 size, Int32 bufferSize ) : void
stream Stream
size System.Int64
bufferSize System.Int32
return void

ReceiveWhatsAvailable() public method

public ReceiveWhatsAvailable ( Byte buffer, Int32 offset, Int32 size ) : Int32
buffer Byte
offset System.Int32
size System.Int32
return System.Int32

ResetStatistics() public method

public ResetStatistics ( ) : void
return void

Seek() public method

public Seek ( System.Int64 offset, SeekOrigin origin ) : System.Int64
offset System.Int64
origin SeekOrigin
return System.Int64

Send() public method

public Send ( Byte buffer ) : Int32
buffer Byte
return System.Int32

Send() public method

public Send ( Byte buffer, Int32 offset, Int32 size ) : Int32
buffer Byte
offset System.Int32
size System.Int32
return System.Int32

SendFromStream() public method

public SendFromStream ( Stream stream ) : void
stream Stream
return void

SendFromStream() public method

public SendFromStream ( Stream stream, System.Int64 size ) : void
stream Stream
size System.Int64
return void

SendFromStream() public method

public SendFromStream ( Stream stream, System.Int64 size, Int32 bufferSize ) : void
stream Stream
size System.Int64
bufferSize System.Int32
return void

SetLength() public method

public SetLength ( System.Int64 length ) : void
length System.Int64
return void

SkipBytes() public method

public SkipBytes ( Int32 size ) : void
size System.Int32
return void

StartTimeoutTimer() protected method

protected StartTimeoutTimer ( ) : void
return void

StopTimeoutTimer() protected method

protected StopTimeoutTimer ( ) : void
return void

ToString() public method

public ToString ( ) : String
return String

TriggerAsyncDisconnect() protected method

protected TriggerAsyncDisconnect ( ) : void
return void

TriggerAsyncHaveIncompleteData() protected method

protected TriggerAsyncHaveIncompleteData ( ) : void
return void

TriggerOnBytesReceived() protected method

protected TriggerOnBytesReceived ( System.Int64 count ) : void
count System.Int64
return void

TriggerOnBytesSent() protected method

protected TriggerOnBytesSent ( System.Int64 count ) : void
count System.Int64
return void

Write() public method

public Write ( Byte buffer, Int32 offset, Int32 size ) : void
buffer Byte
offset System.Int32
size System.Int32
return void

WriteLine() public method

public WriteLine ( String line ) : void
line String
return void

WriteLineLF() public method

public WriteLineLF ( String line ) : void
line String
return void

Property Details

CRLF public property

public Byte[] CRLF
return Byte[]

LF public property

public Byte[] LF
return Byte[]