|

楼主 |
发表于 2010-7-22 05:22:29
|
显示全部楼层
无意间终于找到解决方法,太高心了,我编写的服务端终于跨平台了
贴些文档:
* Indy10 servers didn't work before due to an exception occuring during startup, which shut everything down. You need FPC 2.2(.0) or later to fix this (pthread_kill problem). This probably also affects Mac OS X.
* During demo conversion, the bindings property is often wrongly converted. This can result in strange errors, specially because Indy seems to bind to the same port using both IPV4 and IPV6 from time to time. Not fully debugged yet.
Unbuntu 10.04 + Lazarus 0.9.28 + Indy 10(Server Component) -> launch & do nothing (just crash)
Solution (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);
begin
//uses idGlobal , the Id_IPv4 force the IdTCPServer to work in Id_IPV4 mode.
IdTCPServer1.Bindings.Add.IPVersion := Id_IPv4; //else, throw socket error # 98 , address already in use ...
IdTCPServer1.Bindings.Add.IP:='127.0.0.1';
IdTCPServer1.Bindings.Add.Port:= 6501; //customization
IdTCPServer1.Active:=true;
end;
(3)use TIdSync to Control your GUI in IdTCPServer's OnExecute() even. |
|