我在在线程中做SOCKET通讯,并且做客户端,用的TCLIENTSOCKET控件,在关闭线程时,始终报错,不知是不是TCLIENTSOCKET这个控件不能用于线程中?
线程中的创建:construncor TCSThread.create;
begin
myclientsocket:= Tclientsocket.create(nil);
...
myclientsocket.active:= true;
inherited create(false);
end;线程中释放:
destructor destroy;
begin
myclientsocket.close;
myclientsocket.free;//如果不加这句就不会在后面报错
inherited;
end;//报错,
线程中的创建:construncor TCSThread.create;
begin
myclientsocket:= Tclientsocket.create(nil);
...
myclientsocket.active:= true;
inherited create(false);
end;线程中释放:
destructor destroy;
begin
myclientsocket.close;
myclientsocket.free;//如果不加这句就不会在后面报错
inherited;
end;//报错,
解决方案 »
- 如何让DBgrid的列宽度自动适应字段的实际字符宽度,不是字段的宽度?
- "a call to an os function failed"怎么解决?
- 再线关注。请大家帮忙了。delphi7+mysql+ado+dbgrid的一个问题。
- 请教一个简单的sql语句的写法,在线等待!!!
- 加密解密
- 多线程问题
- 在线等待,急用!!!
- 请问我的想法是否可行?能不能这样提高工作效率?
- 如何控制ScrollBar
- 谁做过帮助文件?
- **** 并非老调重弹!是没有好的方案!Row cannot located for updating.Some values may have been changed since it was last read
- 数据转换问题,如何转换为无符号32位类型的数据
begin
myclientsocket.close;
while true do
if myclientsocket.active=false then
break;
myclientsocket.free;
inherited;
end;