예제 #1
0
        public bool Init(string network)
        {
            m_address = new PgmAddress(network);

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

            m_handle = m_pgmSocket.FD;

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

            m_socket.EventListening(m_address.ToString(), m_handle);

            return true;
        }
예제 #2
0
        public void Init(PgmAddress pgmAddress)
        {
            m_pgmSocket = new PgmSocket(m_options, PgmSocketType.Publisher, m_addr.Resolved as PgmAddress);
            m_pgmSocket.Init();

            m_socket = m_pgmSocket.FD;

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

            m_socket.Bind(localEndpoint);

            m_pgmSocket.InitOptions();

            m_socket.Connect(pgmAddress.Address);
            m_socket.Blocking = false;

            m_outBufferSize = Config.PgmMaxTPDU;
            m_outBuffer = new ByteArraySegment(new byte[m_outBufferSize]);
        }
예제 #3
0
        public void Init(PgmAddress pgmAddress)
        {
            m_pgmSocket = new PgmSocket(m_options, PgmSocketType.Publisher, m_addr.Resolved as PgmAddress);
            m_pgmSocket.Init();

            m_socket = m_pgmSocket.FD;

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

            m_socket.Bind(localEndpoint);

            m_pgmSocket.InitOptions();

            m_socket.Connect(pgmAddress.Address);
            m_socket.Blocking = false;

            m_outBufferSize = Config.PgmMaxTPDU;
            m_outBuffer     = new ByteArraySegment(new byte[m_outBufferSize]);
        }
예제 #4
0
        public void Init(string network)
        {
            m_address = new PgmAddress(network);

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

            m_handle = m_pgmSocket.FD;

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

                throw NetMQException.Create(ex);
            }

            m_socket.EventListening(m_address.ToString(), m_handle);
        }
예제 #5
0
        public void Init(string network)
        {
            m_address = new PgmAddress(network);

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

            m_handle = m_pgmSocket.FD;

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

                throw NetMQException.Create(ex);
            }

            m_socket.EventListening(m_address.ToString(), m_handle);
        }
예제 #6
0
 public PgmSocket(Options options, PgmSocketType pgmSocketType, PgmAddress pgmAddress)
 {
     m_options       = options;
     m_pgmSocketType = pgmSocketType;
     m_pgmAddress    = pgmAddress;
 }
예제 #7
0
파일: PgmSocket.cs 프로젝트: bubbafat/netmq
 public PgmSocket(Options options, PgmSocketType pgmSocketType, PgmAddress pgmAddress)
 {
     m_options = options;
     m_pgmSocketType = pgmSocketType;
     m_pgmAddress = pgmAddress;
 }