예제 #1
0
 public PgmReceiver(string address, int port, ISourceReader reader)
 {
     _socket = new PgmSocket();
     _ip     = address;
     _port   = port;
     _reader = reader;
 }
예제 #2
0
 public PgmReceiver(string address, int port, ISourceReader reader)
 {
     _socket = new PgmSocket();
     _ip = address;
     _port = port;
     _reader = reader;
 }
예제 #3
0
파일: PgmSource.cs 프로젝트: ArturD/Daemons
        public void Start()
        {
            IPAddress  ipAddr = IPAddress.Parse(_ip);
            IPEndPoint end    = new IPEndPoint(ipAddr, _port);

            _socket.SendBufferSize = _sendSocketSize;
            IPAddress local = IPAddress.Any;

            if (_bindInterface != null)
            {
                local = IPAddress.Parse(_bindInterface);
            }
            _socket.Bind(new IPEndPoint(local, _bindPort));
            SetSendWindow();
            PgmSocket.EnableGigabit(_socket);
            _socket.ApplySocketOptions();
            _socket.Connect(end);
        }
예제 #4
0
        public void Start()
        {
            _socket.ReceiveBufferSize = _receiveBufferInBytes;
            IPAddress  ipAddr = IPAddress.Parse(_ip);
            IPEndPoint end    = new IPEndPoint(ipAddr, _port);

            _socket.Bind(end);
            foreach (uint address in _interfaceAddresses)
            {
                byte[] bits = BitConverter.GetBytes(address);
                _socket.SetPgmOption(PgmConstants.RM_ADD_RECEIVE_IF, bits);
            }
            _socket.ApplySocketOptions();
            PgmSocket.EnableGigabit(_socket);
            _socket.Listen(5);
            log.Info("Listening: " + end);
            _socket.BeginAccept(OnAccept, null);
        }
예제 #5
0
파일: PgmReader.cs 프로젝트: ArturD/Daemons
 public void AcceptSocket(Socket receiveSocket, IAcceptor acceptor)
 {
     try
     {
         IByteParser parser = _parserFactory.Create(receiveSocket);
         PgmSocket.EnableGigabit(receiveSocket);
         if (_receiveBufferSize > 0)
         {
             receiveSocket.ReceiveBufferSize = _receiveBufferSize;
         }
         byte[]      buffer = new byte[_readBuffer];
         AsyncReader reader = new AsyncReader(parser, buffer, acceptor, this, receiveSocket);
         reader.BeginReceive();
     }catch (Exception failed)
     {
         receiveSocket.Close();
         log.Error("BeginReceive Failed", failed);
     }
 }
예제 #6
0
파일: PgmSource.cs 프로젝트: ArturD/Daemons
 public PgmSource(string address, int port)
 {
     _socket = new PgmSocket();
     _ip     = address;
     _port   = port;
 }
예제 #7
0
파일: PgmSource.cs 프로젝트: ArturD/Daemons
 public PgmSource(string address, int port)
 {
     _socket = new PgmSocket();
     _ip = address;
     _port = port;
 }