16line에서 에러가 발생을 하는데 어떤문제인지..........
에러발생상황은 Client에서 Server와 연결버튼을 누르면 Server에서
Client에서 연결시도한 닉네임이 Server쪽에 등록이 되어야하는데 등록이 안됩니다. 어찌된 일인지.. 봐도봐도 처리가 안되더라구여!! 잘못된부분 지적해주세요!
--------------------------------------------------------------------
procedure TForm1.BroadCastMessage( ByWho, TheMessage : String );
var
Count: Integer;
List : TList;
//EMote,
Msg : String;
begin
Msg := {ByWho + ' : ' + }(TheMessage);
{ EMote := Trim(ListBox1.Lines.Values[Msg]);
If WhoFrom <> 'System' then
Msg := WhoFrom + ': ' + Msg;
If EMote <> '' then
Msg := Format(Trim(EMote), [WhoFrom]);
List := IdTCPServer1.Threads.LockList;
} Try __________________
For Count := 0 to List.Count - 1 do ---->| Error 발생합니다.|
Try ------------------
TIdPeerThread(List.Items[Count]).ConNecTion.WriteLn(Msg);
Except
TIdPeerThread(List.Items[Count]).Stop;
End;
Finally
IdTCPServer1.Threads.UnlockList;
End;
end;
List := IdTCPServer1.Threads.LockList;
위 부분이 주석처리 되어있네요... 그러니까 List가 nil이기 때문에 for 문돌때 에러나는거 같네요...
^^ 항상 즐코하세요...