Method | Description | |
---|---|---|
BeginRead ( byte buffer, int offset, int size, AsyncCallback callback, object state ) : IAsyncResult |
Begins an asynchronous reading from the network stream. The BeginRead method starts an asynchronous read operation from the network stream. It returns immediately and does not wait for the asynchronous call to complete. The BytesRoad.Net.Sockets.NetworkStreamEx.EndRead method is used to retrieve the results of the asynchronous call. It can be called any time after BeginRead; if the asynchronous call has not completed, EndRead will block until it completes. The read operation will not completed until the number of bytes specified by size parameter is read from the stream. If the remote host shuts down the BytesRoad.Net.Sockets.SocketEx connection with the BytesRoad.Net.Sockets.SocketEx.Shutdown method, and all available data has been received, the Read method will complete and return number of bytes was read. |
|
BeginWrite ( byte buffer, int offset, int size, AsyncCallback callback, object state ) : IAsyncResult |
Begins an asynchronous write to the network stream. The BeginWrite method starts an asynchronous write operation. It returns immediately and does not wait for the asynchronous call to complete. The BytesRoad.Net.Sockets.NetworkStreamEx.EndWrite method is used to retrieve the results of the asynchronous call. It can be called any time after BeginWrite; if the asynchronous call has not completed, EndWrite will block until it completes. Write operation will not completed until all data, specified by size parameter, are sent. |
|
Close ( ) : void |
Releases the resources used by the BytesRoad.Net.Sockets.NetworkStreamEx. Internally simply calls BytesRoad.Net.Sockets.NetworkStreamEx.Dispose, which depending on the ownership of underlying BytesRoad.Net.Sockets.SocketEx will call BytesRoad.Net.Sockets.SocketEx.Close method. |
|
EndRead ( IAsyncResult asyncResult ) : int |
Ends a pending asynchronous read. EndRead is a blocking method that completes the asynchronous read operation started in the BytesRoad.Net.Sockets.NetworkStreamEx.BeginRead method. The read operation will not completed until the number of bytes specified by size parameter (to BeginRead method) is read from the stream. If the remote host shuts down the BytesRoad.Net.Sockets.SocketEx connection with the BytesRoad.Net.Sockets.SocketEx.Shutdown method, and all available data has been received, the Read method will complete and return number of bytes was read. |
|
EndWrite ( IAsyncResult asyncResult ) : void |
Ends a pending asynchronous write. EndWrite is a blocking method that completes the asynchronous write operation started in the BytesRoad.Net.Sockets.NetworkStreamEx.BeginWrite method. EndWrite will block until all data, specified by size parameter to BeginWrite method, are sent. |
|
Flush ( ) : void |
Flushes data from the stream. Has no effect when applied to BytesRoad.Net.Sockets.NetworkStreamEx. Has no effect when applied to BytesRoad.Net.Sockets.NetworkStreamEx. |
|
NetworkStreamEx ( |
Creates the network stream for the specified BytesRoad.Net.Sockets.SocketEx. The BytesRoad.Net.Sockets.NetworkStreamEx is created with read/write access to the specified BytesRoad.Net.Sockets.SocketEx. The NetworkStreamEx does not own the underlying SocketEx, so calling the BytesRoad.Net.Sockets.NetworkStreamEx.Close method will not close the SocketEx. |
|
NetworkStreamEx ( |
Creates the network stream for the BytesRoad.Net.Sockets.SocketEx with the specified access rights. When BytesRoad.Net.Sockets.NetworkStreamEx created with this constructor, it does not own the underlying BytesRoad.Net.Sockets.SocketEx, so calling the NetworkStreamEx's BytesRoad.Net.Sockets.NetworkStreamEx.Close method will not close the underlying SocketEx. The access parameter sets the BytesRoad.Net.Sockets.NetworkStreamEx.CanRead and BytesRoad.Net.Sockets.NetworkStreamEx.CanWrite properties of the NetworkStreamEx. If you specify System.IO.FileAccess.Write, then the NetworkStreamEx will allow writing operations only. If you specify System.IO.FileAccess.Read, then the NetworkStreamEx will allow read operations only. If you specify System.IO.FileAccess.ReadWrite, both types of operations will be allowed. |
|
NetworkStreamEx ( |
Creates the network stream for the BytesRoad.Net.Sockets.SocketEx with the specified access rights and ownership. If ownsSocket is true, the NetworkStreamEx takes ownership of the underlying BytesRoad.Net.Sockets.SocketEx, and calling the NetworkStreamEx's BytesRoad.Net.Sockets.NetworkStreamEx.Close method will also close the underlying SocketEx. The access parameter sets the BytesRoad.Net.Sockets.NetworkStreamEx.CanRead and BytesRoad.Net.Sockets.NetworkStreamEx.CanWrite properties of the NetworkStreamEx. If you specify System.IO.FileAccess.Write, then the NetworkStreamEx will allow writing operations only. If you specify System.IO.FileAccess.Read, then the NetworkStreamEx will allow read operations only. If you specify System.IO.FileAccess.ReadWrite, both types of operations will be allowed. |
|
NetworkStreamEx ( |
Creates the network stream for the BytesRoad.Net.Sockets.SocketEx with the specified ownership. The BytesRoad.Net.Sockets.NetworkStreamEx is created with read/write access to the specified BytesRoad.Net.Sockets.SocketEx. If ownsSocket is true, the NetworkStreamEx takes ownership of the underlying BytesRoad.Net.Sockets.SocketEx, and calling the NetworkStreamEx's BytesRoad.Net.Sockets.NetworkStreamEx.Close method will also close the underlying SocketEx. |
|
Read ( byte buffer, int offset, int size ) : int |
Reads data from the network stream. If no data is available for reading, the Read method will block until data is available. You can use the BytesRoad.Net.Sockets.NetworkStreamEx.DataAvailable property to determine if data is available for reading. When BytesRoad.Net.Sockets.NetworkStreamEx.DataAvailable is non-zero, retry the receive operation. The Read method will read as much data as specified by size parameter. If the remote host shuts down the BytesRoad.Net.Sockets.SocketEx connection with the BytesRoad.Net.Sockets.SocketEx.Shutdown method, and all available data has been received, the Read method will complete and return number of bytes was read. |
|
Seek ( long offset, SeekOrigin origin ) : long |
Changes the current position in the stream. This method always throws a System.NotSupportedException. Always throws a System.NotSupportedException. |
|
SetLength ( long value ) : void |
Sets the length of the stream. This method always throws a System.NotSupportedException. Always throws a System.NotSupportedException. |
|
Write ( byte buffer, int offset, int size ) : void |
Writes data to the network stream. Write method will block until all data, specified by size parameter, are sent. |
|
mDispose ( ) : void |
Releases all resources used by the BytesRoad.Net.Sockets.NetworkStreamEx. Call Dispose when you are finished using the BytesRoad.Net.Sockets.NetworkStreamEx. If the NetworkStreamEx owns the underlying BytesRoad.Net.Sockets.SocketEx the Dispose method will call BytesRoad.Net.Sockets.SocketEx.Close method to release SocketEx object used for network communications. The Dispose method leaves the NetworkStreamEx in an unusable state. After calling Dispose, you must release all references to the NetworkStreamEx so the garbage collector can reclaim the memory that the NetworkStreamEx was occupying. |
Method | Description | |
---|---|---|
mDispose ( bool disposing ) : void |
Releases the unmanaged resources used by the BytesRoad.Net.Sockets.NetworkStreamEx and optionally releases the managed resources. This method is called by the public |
Method | Description | |
---|---|---|
CheckDisposed ( ) : void | ||
GetDisposedException ( ) : |
||
Read_End ( IAsyncResult ar ) : void | ||
Send_End ( IAsyncResult ar ) : void | ||
ThrowMetUnsupported ( string metName ) : void | ||
ThrowPropUnsupported ( string propName ) : void |
public BeginRead ( byte buffer, int offset, int size, AsyncCallback callback, object state ) : IAsyncResult | ||
buffer | byte | The buffer to store data to. |
offset | int | The location in the buffer where to start storing the received data. |
size | int | The number of bytes to read. |
callback | AsyncCallback |
/// The |
state | object | /// An object containing state information for this request. /// |
return | IAsyncResult |
public BeginWrite ( byte buffer, int offset, int size, AsyncCallback callback, object state ) : IAsyncResult | ||
buffer | byte | Data to write. |
offset | int | The position in the data buffer from which to begin writing. |
size | int | The number of bytes to write. |
callback | AsyncCallback |
/// The |
state | object | /// An object containing state information for this request. /// |
return | IAsyncResult |
public EndRead ( IAsyncResult asyncResult ) : int | ||
asyncResult | IAsyncResult |
/// An
/// |
return | int |
public EndWrite ( IAsyncResult asyncResult ) : void | ||
asyncResult | IAsyncResult |
/// An
/// |
return | void |
public NetworkStreamEx ( |
||
socket |
/// The
/// |
|
return | System |
public NetworkStreamEx ( |
||
socket |
/// The
/// |
|
access | FileAccess |
/// A bitwise combination of the
/// |
return | System |
public NetworkStreamEx ( |
||
socket |
/// The
/// |
|
access | FileAccess |
/// A bitwise combination of the
/// |
ownsSocket | bool |
/// true to indicate that the
/// |
return | System |
public NetworkStreamEx ( |
||
socket |
/// The
/// |
|
ownsSocket | bool |
/// true to indicate that the
/// |
return | System |
public Read ( byte buffer, int offset, int size ) : int | ||
buffer | byte | The buffer to store data to. |
offset | int | The location in the buffer where to start storing the received data. |
size | int | The number of bytes to read. |
return | int |
public Seek ( long offset, SeekOrigin origin ) : long | ||
offset | long | not used. |
origin | SeekOrigin | not used. |
return | long |
public Write ( byte buffer, int offset, int size ) : void | ||
buffer | byte | Data to write. |
offset | int | The position in the data buffer from which to begin writing. |
size | int | The number of bytes to write. |
return | void |
protected mDispose ( bool disposing ) : void | ||
disposing | bool | /// true to release both managed and unmanaged resources; /// false to release only unmanaged resources. /// |
return | void |