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.String | multicastAddress | the multicast address |
System.Int32 | port | the transport port |
Properties
IsBlockingSocket
Declaration
public virtual bool IsBlockingSocket { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
IsOpen
Returns true if transport is open.
Declaration
public virtual bool IsOpen { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
IsSecured
Returns true, if connected through secured connection.
Declaration
public virtual bool IsSecured { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
LocalEndPoint
Gets local IPEndPint after the transport connected.
Declaration
public IPEndPoint LocalEndPoint { get; }
Property Value
Type | Description |
---|---|
System.Net.IPEndPoint |
NetworkInterfaceName
Setter for network interface.
Declaration
public virtual string NetworkInterfaceName { set; }
Property Value
Type | Description |
---|---|
System.String |
RemoteEndPoint
Gets the remote IPEndPoint after the transport connected.
Declaration
public IPEndPoint RemoteEndPoint { get; }
Property Value
Type | Description |
---|---|
System.Net.IPEndPoint |
Methods
Close()
Closes the transport.
Leave a multicast group and close socket.
Declaration
public virtual void Close()
Exceptions
Type | Condition |
---|---|
System.IO.IOException | 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.IO.IOException | if an I/O error occurs |
Read(ByteBuffer)
Declaration
public virtual int Read(ByteBuffer buffer)
Parameters
Type | Name | Description |
---|---|---|
ByteBuffer | buffer |
Returns
Type | Description |
---|---|
System.Int32 |
Read(ByteBuffer, Int32, Int32)
Declaration
public virtual int Read(ByteBuffer buffer, int offset, int length)
Parameters
Type | Name | Description |
---|---|---|
ByteBuffer | buffer | |
System.Int32 | offset | |
System.Int32 | length |
Returns
Type | Description |
---|---|
System.Int32 |
Read(Byte[])
Transport dependent read method.
Declaration
public virtual int Read(byte[] buffer)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | buffer | holder for read bytes |
Returns
Type | Description |
---|---|
System.Int32 | number of byte actually read |
Exceptions
Type | Condition |
---|---|
System.IO.IOException | 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.Byte[] | buffer | holder for read bytes |
System.Int32 | offset | in buffer |
System.Int32 | length | maximum bytes to be read |
Returns
Type | Description |
---|---|
System.Int32 | number of byte actually read |
Exceptions
Type | Condition |
---|---|
System.IO.IOException | if unable to read |
SetBufferSize(Int32)
Declaration
public virtual void SetBufferSize(int value)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | value |
WaitUntilReadyToWrite()
Declaration
public virtual void WaitUntilReadyToWrite()
Write(ByteBuffer)
Declaration
public virtual int Write(ByteBuffer buffer)
Parameters
Type | Name | Description |
---|---|---|
ByteBuffer | buffer |
Returns
Type | Description |
---|---|
System.Int32 |
Write(ByteBuffer, Int32, Int32)
Declaration
public virtual int Write(ByteBuffer buffer, int offset, int length)
Parameters
Type | Name | Description |
---|---|---|
ByteBuffer | buffer | |
System.Int32 | offset | |
System.Int32 | length |
Returns
Type | Description |
---|---|
System.Int32 |
Write(Byte[])
Transport dependent write method.
Declaration
public virtual void Write(byte[] message)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | message | actual message |
Exceptions
Type | Condition |
---|---|
System.IO.IOException | 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.Byte[] | message | actual message |
System.Int32 | offset | the offset in buffer |
System.Int32 | length | the num of bytes to write |
Returns
Type | Description |
---|---|
System.Int32 |
Exceptions
Type | Condition |
---|---|
System.IO.IOException | if unable to write |