public static SessionBase Create([NotNull] IOThread ioThread, bool connect, [NotNull] SocketBase socket, [NotNull] Options options, [NotNull] Address addr)
{
switch (options.SocketType)
{
case ZmqSocketType.Req:
return new Req.ReqSession(ioThread, connect, socket, options, addr);
case ZmqSocketType.Dealer:
return new Dealer.DealerSession(ioThread, connect, socket, options, addr);
case ZmqSocketType.Rep:
return new Rep.RepSession(ioThread, connect, socket, options, addr);
case ZmqSocketType.Router:
return new Router.RouterSession(ioThread, connect, socket, options, addr);
case ZmqSocketType.Pub:
return new Pub.PubSession(ioThread, connect, socket, options, addr);
case ZmqSocketType.Xpub:
return new XPub.XPubSession(ioThread, connect, socket, options, addr);
case ZmqSocketType.Sub:
return new Sub.SubSession(ioThread, connect, socket, options, addr);
case ZmqSocketType.Xsub:
return new XSub.XSubSession(ioThread, connect, socket, options, addr);
case ZmqSocketType.Push:
return new Push.PushSession(ioThread, connect, socket, options, addr);
case ZmqSocketType.Pull:
return new Pull.PullSession(ioThread, connect, socket, options, addr);
case ZmqSocketType.Pair:
return new Pair.PairSession(ioThread, connect, socket, options, addr);
case ZmqSocketType.Stream:
return new Stream.StreamSession(ioThread, connect, socket, options, addr);
default:
throw new InvalidException("SessionBase.Create called with invalid SocketType of " + options.SocketType);
}
}