public int SendMessage(string ip, int port, Buffer buffer) { var ipAddress = IPAddress.Parse(ip); var remoteEndpoint = new IPEndPoint(ipAddress, port); return(InternalSocket.SendTo(Buffer.GetBuffer(buffer), remoteEndpoint)); }
public static byte[] GetBufferRef(Buffer buffer) { if (buffer == null) { throw new ArgumentNullException("buffer"); } buffer.ClearBuffer(); return(buffer.GetBuffer()); }
public static byte[] GetBuffer(Buffer buffer) { if (buffer == null) { throw new ArgumentNullException("buffer"); } if (!buffer.finalized) { throw new BufferFinalizedException("Buffer provided is not in 'finalized' state. You must call 'FinalizeBuffer()' in order to get the full buffer"); } return(buffer.GetBuffer()); }
public int SendMessage(Buffer buffer) { return(InternalSocket.Send(Buffer.GetBuffer(buffer))); }