Indy with Lazarus/ko

From Lazarus wiki
Jump to navigationJump to search

Deutsch (de) English (en) español (es) français (fr) 日本語 (ja) 한국어 (ko)

라자루스용 인디

A new attempt at converting Indy is being undertaken by the Indy core team. FPC developer Marco van de Voort is working with Indy core to get Indy fully working with FPC/Lazarus. Specially Indy's JP Mugaas did a lot of good work in getting Indy10 to work with FPC. The native unixrtl backend is mostly his work too.

Currently Indy10 is nearly fully working, and end-user usability has been improved a lot. Only special topics like OpenSSL and compression might need additional knowledge. 64-bit support hasn't entirely been validated either.

Hint: I'm not very interested in support the Kylix side of Indy. (anything that uses unit libc). I ported it only as step up to native Unix RTL using Indy apps.

요구사항

Currently, FPC 2.0.4 is very close to being able to use indy in all its facets, except for the server bug on FreeBSD/Mac OS X (which requires 2.1.1)

Since Indy10 now works for all major targets, we focus on this version. While conversion to Indy9 might be simpler for people, keep in mind that it only works on win32. (and theoretically could be ported to Linux/x86).

Therefore we recommend people to work with 10 as much as possible.

(For indy9, you might need to remove the overriding of tmemorystream.setsize method (Marcov: ???) to get telnet components working, but Indy9 hasn't been tested in a while)

The port is fairly stable, and JP Mugaas has done a great deal to improve the quality of the release, a set of makefiles inclusive

다운로드/링크

Current snapshots (for die hards only) are at

동작 기능과 미구현 기능

Indy9:

  • 윈도우에선 대부분 동작한다. 거의 모든 데모가 포팅되었습니다.
  • 리눅스에선 거의 동작 하지 않는다. Linux/x86계열(카이릭스 제외)을 제외한 대상은 희망이 없습니다. <-- 거의 모든 리눅스에서 동작하지 않는다(주)

Indy10:

  • 윈도우, 유닉스: 클라이언트 동작, 원칙적으로 서버 역시 동작한다.
  • 유닉스 RTL의 주요기능은 동작한다. OS X, FreeBSD의 서버,클라이언트도 동일하게 동작한다.

모든버전: 보안관련 기능은 아직 테스트 되지 않음.

단기 개발 계획

  • 데모 소스를 동작하도록 변환 예정.
  • 버그 수정 및 FPC와 Indy RCS를 재수정 할 계획.

문제점들

  • Indy9 and Indy10 are mutually exclusive, which causes problems for deployment, even the default is a problem:
    • Indy9 is more used and proven in the industry.
    • Indy10 is more portable, and better long term. However uptake seems to be low, and there is not much movement at Indy anymore.
  • How to deploy? Parts belong to Lazarus, parts to FPC.
  • Lot of pkgs and demos have paths in them. How to centrally fix them so that inexperienced users can build them?
  • Lazarus problems
    • Transparency problems of icons
    • component tabs don't scroll, if you put a lot of components in one tab, they are not selectable. workaround implemented: JP Mugaas separated them into Indy clients A-M and N-Z etc. Also, meanwhile Lazarus changed to two rows of components per tab.
  • Indy demos (specially Indy10's) are not very suitable for multiplatform usage. Their setup is awfully windows specific, with spaces in paths, deep nested dirs, and useless baggage (C# code). A short working set of demos will have to be created.

버그

  • Indy10 서버는 시작 시 예외가 발생하여 종료되기 때문에 동작하지 않는다. FPC 2.2(.0) 또는 그 이상 버전에서 수정되었다.(pthread_kill 문제). 이 문제는 Max OS X에서도 동일하게 나타난다.
  • 데모를 변환시에, 빈번하게 바인딩 프로버티(속성)가 잘못 변환 되었다. 이러한 원인은 인디가 IP4와 IP6를 동시에 사용해서 동일한 포트로 바인딩 하는것 때문에 비정상적으로 동작 할 수 있다.
  • Ubuntu 10.04 + Lazarus 0.9.28 + Indy 10(Server Component) -> launch & do nothing (just crash)

해결방법 (bruce0829@yahoo.com.tw collect and organize data):

(1).Lazarus Main menu -> Project -> Compiler Options -> Other Page , add the "-dUseCThreads" parameter.

(2).force the IdTCPServer to work in Id_IPV4 mode.

procedure TForm1.FormActivate(Sender: TObject);
var
  Binding: TIdSocketHandle;
begin 
  //uses idGlobal
  //explicitly adding a Binding object prevents TIdTCPServer
  //from creating its own default IPv4 and IPv6 Binding objects
  //on the same listening IP/Port pair...
  Binding := IdTCPServer1.Bindings.Add;
  Binding.IPVersion := Id_IPv4; //optional: forces the Binding to work in Id_IPV4 mode.
  Binding.IP := '127.0.0.1';
  Binding.Port := 6501; //customization 
  IdTCPServer1.Active := True;  
end;

(3)use TIdSync to Control your GUI in IdTCPServer's OnExecute() even.

설치방법

이방법은 완벽하지 않지만,원한다면 다음과 같이 설치를 할 수 있다. :Matthijs

  • indysystemlaz.lpk 열고 컴파일
  • indycorelaz.lpk 열고 컴파일
  • indyprotocolslaz.lpk 열고 컴파일
  • dclindycorelaz.lpk 열고 컴파일 후 설치
  • dclindyprotocolslaz.lpk 열고 컴파일 후 설치

라자루스 리빌드 후 15개의 인디 컴포넌츠 탭을 볼 수 있을 것이다.

데비안/우분투 설치방법

  • # cd indy-10.2.0.1/fpc
  • # chmod +x debian/rules
  • # touch README
  • # sudo apt-get install fakeroot
  • # dpkg-buildpackage -rfakeroot -uc
  • # cd ..
  • # sudo dpkg -i *.deb
  • install package indylaz.lpk in lazarus

설치방법 [2]

If you couldn't install Indy for Lazarus with tips above, you can try this...

From Yahoo! Brazil, Lazarus Group (User Everaldo)

Version installed on Lazarus 0.9.24 using component indy-10.2.0.1.

  • Unzip the component from file tar.gz (must be this file, the "zip file" does not work) in directory $(LazarusDir)\components;
  • Go to directory $(LazarusDir)\components\indy-10.2.0.1\ and to create inside them a directory named "saved";
  • Copy the content of the directory $(LazarusDir)\components\indy-10.2.0.1\lazarus\ to directory "saved" created above;
  • Copy the content of directory $(LazarusDir)\components\indy-10.2.0.1\fpc\ to directory $(LazarusDir)\components\indy-10.2.0.1\lazarus, and rewrite all files, ok;
  • Get the content of directory "saved" and copy inside of $(LazarusDir)\components\indy-10.2.0.1\lazarus and you can delete "saved" directory now;
  • Install the package laz.lpk (available in $(LazarusDir)\components\indy-10.2.0.1\lazarus\indy) of conventional way.

On LINUX the path is: /usr/lib/lazarus/components/indy-10.2.0.1/

How to install [3] Windows, Indy 10.5.8.0 and above

  • Need working Lazarus (and FPC) for this
  • Download from http://www.indyproject.org/Sockets/Download/DevSnapshot.EN.aspx. Or from the alternate web site for the updated and current versions: http://indy.fulgan.com/
  • unpack into a directory
  • copy the *.pas, *.lrs and *.inc of the \Lib\System, \Lib\Core, and \Lib\Protocols subdirectories into a new directory of your choosing
  • copy the indylaz.lpk in the \Lib directory to the directory you created above
  • from within Lazarus do a Package -> Open package file, open the indylaz.lpk
  • in the Package Options dialog, add the path to the directory you created above to the "Unit" field.
  • compile then install (will rebuild Lazarus). EDIT: Currently, due to a know bug in FPC, you must compile the Indy package TWICE before installing it.

In order to write & compile Indy10 applications, you need to put the path to the Indy directory in the "Other Unit files" textbox of every project that you write. You'll find "Other Unit files" under Project Options -> Compiler Options -> Paths.

윈도우(기본) 설치방법 - Indy 10.2.03

For a lot of users, I'm sure that the information given above won't work, or will be somewhat confusing given the differences between versions and inconsistent explanations.

The website points you to download the latest version from the snapshots page.
This wiki tells you to copy a lot of files over into directories.
For me, neither worked, and ended up making a mess of my Lazarus installations.
  1. Firstly, the page I would retrieve this from is here. Other sites I tried had problems with some files inside the archive.
  2. When you open up the archive above, you will see there are folders: "fpc" and "lazarus".
    1. You can copy the contents of "fpc" into: LAZARUS_DIR\fpc\2.6.(0)\source\packages\indylaz if you want to have things neat and tidy.
    2. The "lazarus" folder, you copy into LAZARUS_DIR\components\indylaz
    3. With both of these, make sure that there isn't a sub-directory inside the folders given.
i.e. LAZARUS_DIR\components\indylaz\lazarus\
  1. Go into Lazarus and go to "Package" -> "Open package file" and point it to the "indylaz.lpk" inside the LAZARUS_DIR\components\indylaz directory.
  2. Once the package loads inside your project, click on the "options" button, which resembles an image of a parcel with a cog next to it.
  3. Click the "Compiler Options" on the left-hand side and Click on the ".." button next to "Other unit files (-Fu) (delimiter is semicolon)".
Select the "fpc" folder you created above and click OK.
Lazarus will sort out the relative path for you. Don't change it.
  1. Click OK and compile and then direct angry bile towards the individual who has steered you wrong with the previous, unhelpful, instructions.

윈도우64비트 이슈사항

64비트에서는 아래의 코드가 정상적으로 동작 하지 않습니다. IdAntiFreeze.pas의 내용을 아래와 같이 수정하면 해결할 수 있습니다.

수정전:

type
  TIdAntiFreeze = class(TIdAntiFreezeBase)
  public
    procedure Process; override;
  end; 

수정후:

type
  TIdAntiFreeze = class(TIdAntiFreezeBase)
  public
    {$IFDEF WIN32}
    procedure Process; override;
    {$ENDIF}
  end;

외부 링크