Beispiel #1
0
        public void Init([NotNull] PgmAddress pgmAddress)
        {
            this.m_pgmAddress = pgmAddress;

            this.m_pgmSocket = new PgmSocket(this.m_options, PgmSocketType.Publisher, (PgmAddress)this.m_addr.Resolved);
            this.m_pgmSocket.Init();

            this.m_socket = this.m_pgmSocket.Handle;

            IPEndPoint localEndpoint = new IPEndPoint(IPAddress.Any, 0);

            this.m_socket.Bind(localEndpoint);

            this.m_pgmSocket.InitOptions();

            this.m_outBufferSize = this.m_options.PgmMaxTransportServiceDataUnitLength;
            this.m_outBuffer     = new ByteArraySegment(new byte[this.m_outBufferSize]);
        }
Beispiel #2
0
        /// <exception cref="InvalidException">Unable to parse the address's port number, or the IP address could not be parsed.</exception>
        /// <exception cref="NetMQException">Error establishing underlying socket.</exception>
        public void Init([NotNull] string network)
        {
            this.m_address = new PgmAddress(network);

            this.m_pgmSocket = new PgmSocket(this.m_options, PgmSocketType.Listener, this.m_address);
            this.m_pgmSocket.Init();

            this.m_handle = this.m_pgmSocket.Handle;

            try
            {
                this.m_handle.Bind(this.m_address.Address);
                this.m_pgmSocket.InitOptions();
                this.m_handle.Listen(this.m_options.Backlog);
            }
            catch (SocketException ex)
            {
                this.Close();

                throw NetMQException.Create(ex);
            }

            this.m_socket.EventListening(this.m_address.ToString(), this.m_handle);
        }
Beispiel #3
0
 public PgmSocket([NotNull] Options options, PgmSocketType pgmSocketType, [NotNull] PgmAddress pgmAddress)
 {
     this.m_options       = options;
     this.m_pgmSocketType = pgmSocketType;
     this.m_pgmAddress    = pgmAddress;
 }