Example #1
0
        public void Connect()
        {            
            try
            {
                var remoteEp = new IPEndPoint(_host, _port);
                var socket = new Socket(_host.AddressFamily, SocketType.Stream, ProtocolType.Tcp);
                socket.Connect(remoteEp);

                _connection = new Connection.Connection(socket, settings);
                _connection.NewASdu = NewASdu ?? null;
                _connection.ConnectionClosed = ConnectionClosed ?? null;
                _connection.StartDataTransfer();
            }
            catch (Exception e)
            {
                throw new IOException(e.Message);
            }            
        }