using System;
using NetMQ.Core;
namespace NetMQ.Sockets
{
///
/// A PushSocket is a NetMQSocket intended to be used as the "Push" part of the Push-Pull pattern.
/// This will "push" messages to be pulled by the "pull" socket.
///
public class PushSocket : NetMQSocket
{
///
/// Create a new PushSocket and attach socket to zero or more endpoints.
///
/// List of NetMQ endpoints, separated by commas and prefixed by '@' (to bind the socket) or '>' (to connect the socket).
/// Default action is connect (if endpoint doesn't start with '@' or '>')
/// var socket = new PushSocket(">tcp://127.0.0.1:5555,@tcp://127.0.0.1:55556");
public PushSocket(string? connectionString = null) : base(ZmqSocketType.Push, connectionString, DefaultAction.Connect)
{
}
///
/// Create a new PushSocket based upon the given SocketBase.
///
/// the SocketBase to create the new socket from
internal PushSocket(SocketBase socketHandle)
: base(socketHandle)
{
}
/// doesn't support sending, so this override throws .
/// Receive is not supported.
public override bool TryReceive(ref Msg msg, TimeSpan timeout)
{
throw new NotSupportedException("PushSocket doesn't support receiving");
}
}
}