Class UdpTransport
UDP transport implementation.
Inheritance
Implements
Inherited Members
Namespace: FixAntenna.FixEngine.Transport.Client.Udp
Assembly: FixAntenna.Core.dll
Syntax
public class UdpTransport : ITransport
Constructors
UdpTransport(String, Int32)
Creates UDP transport.
Declaration
public UdpTransport(string multicastAddress, int port)
Parameters
Type | Name | Description |
---|---|---|
System. |
multicastAddress | the multicast address |
System. |
port | the transport port |
Properties
IsBlockingSocket
Declaration
public virtual bool IsBlockingSocket { get; }
Property Value
Type | Description |
---|---|
System. |
IsOpen
Returns true if transport is open.
Declaration
public virtual bool IsOpen { get; }
Property Value
Type | Description |
---|---|
System. |
IsSecured
Returns true, if connected through secured connection.
Declaration
public virtual bool IsSecured { get; }
Property Value
Type | Description |
---|---|
System. |
LocalEndPoint
Gets local IPEndPint after the transport connected.
Declaration
public IPEndPoint LocalEndPoint { get; }
Property Value
Type | Description |
---|---|
System. |
NetworkInterfaceName
Setter for network interface.
Declaration
public virtual string NetworkInterfaceName { set; }
Property Value
Type | Description |
---|---|
System. |
RemoteEndPoint
Gets the remote IPEndPoint after the transport connected.
Declaration
public IPEndPoint RemoteEndPoint { get; }
Property Value
Type | Description |
---|---|
System. |
Methods
Close()
Closes the transport.
Leave a multicast group and close socket.
Declaration
public virtual void Close()
Exceptions
Type | Condition |
---|---|
System. |
if an I/O error occurs |
Open()
Method opens the transport. The implementation create a multicast socket and bind it to a specific port, and then joins created socket to multicast group.
Declaration
public virtual void Open()
Exceptions
Type | Condition |
---|---|
System. |
if an I/O error occurs |
Read(ByteBuffer)
Declaration
public virtual int Read(ByteBuffer buffer)
Parameters
Type | Name | Description |
---|---|---|
Byte |
buffer |
Returns
Type | Description |
---|---|
System. |
Read(ByteBuffer, Int32, Int32)
Declaration
public virtual int Read(ByteBuffer buffer, int offset, int length)
Parameters
Type | Name | Description |
---|---|---|
Byte |
buffer | |
System. |
offset | |
System. |
length |
Returns
Type | Description |
---|---|
System. |
Read(Byte[])
Transport dependent read method.
Declaration
public virtual int Read(byte[] buffer)
Parameters
Type | Name | Description |
---|---|---|
System. |
buffer | holder for read bytes |
Returns
Type | Description |
---|---|
System. |
number of byte actually read |
Exceptions
Type | Condition |
---|---|
System. |
if unable to read |
Read(Byte[], Int32, Int32)
Transport dependent read method.
Declaration
public virtual int Read(byte[] buffer, int offset, int length)
Parameters
Type | Name | Description |
---|---|---|
System. |
buffer | holder for read bytes |
System. |
offset | in buffer |
System. |
length | maximum bytes to be read |
Returns
Type | Description |
---|---|
System. |
number of byte actually read |
Exceptions
Type | Condition |
---|---|
System. |
if unable to read |
SetBufferSize(Int32)
Declaration
public virtual void SetBufferSize(int value)
Parameters
Type | Name | Description |
---|---|---|
System. |
value |
WaitUntilReadyToWrite()
Declaration
public virtual void WaitUntilReadyToWrite()
Write(ByteBuffer)
Declaration
public virtual int Write(ByteBuffer buffer)
Parameters
Type | Name | Description |
---|---|---|
Byte |
buffer |
Returns
Type | Description |
---|---|
System. |
Write(ByteBuffer, Int32, Int32)
Declaration
public virtual int Write(ByteBuffer buffer, int offset, int length)
Parameters
Type | Name | Description |
---|---|---|
Byte |
buffer | |
System. |
offset | |
System. |
length |
Returns
Type | Description |
---|---|
System. |
Write(Byte[])
Transport dependent write method.
Declaration
public virtual void Write(byte[] message)
Parameters
Type | Name | Description |
---|---|---|
System. |
message | actual message |
Exceptions
Type | Condition |
---|---|
System. |
if unable to write |
Write(Byte[], Int32, Int32)
Transport dependent write method.
Declaration
public virtual int Write(byte[] message, int offset, int length)
Parameters
Type | Name | Description |
---|---|---|
System. |
message | actual message |
System. |
offset | the offset in buffer |
System. |
length | the num of bytes to write |
Returns
Type | Description |
---|---|
System. |
Exceptions
Type | Condition |
---|---|
System. |
if unable to write |