Registriert seit: 9. Jul 2003
12 Beiträge
|
socket error 10053
21. Jul 2003, 18:24
ich bekomme den socket error 10053 ich hoffe um hilfe.
Server:
Delphi-Quellcode:
procedure Tform1.bsvcontrClick(Sender: TObject);
begin
if serversock.Active then
begin
bsvcontr.caption:='Server ist offline';
serversock.active:=false;
serversock.socket.close;
end else begin
if serversock.Active=false then
begin
bsvcontr.caption:='Server ist online';
serversock.Port:=628;
serversock.active:=true;
serversock.Open;
end;
end;
end;
procedure Tform1.serversockClientWrite(Sender: TObject;
Socket: TCustomWinSocket);
var rec1:iprec;
z:integer;
begin
serversock.Socket.ReceiveBuf(rec1,sizeof(rec1));
z:=serversock.socket.ActiveConnections;
stringgrid.cells[z,1]:=rec1.clientip;
stringgrid.cells[z,2]:=rec1.clienthost;
end;
procedure Tform1.serversockClientRead(Sender: TObject;
Socket: TCustomWinSocket);
var rec1:iprec;
z:integer;
begin
serversock.Socket.ReceiveBuf(rec1,sizeof(rec1));
z:=serversock.socket.ActiveConnections;
stringgrid.cells[z,1]:=rec1.clientip;
stringgrid.cells[z,2]:=rec1.clienthost;
end;
Client:
Delphi-Quellcode:
procedure Tform1.loginbuttonClick(Sender: TObject);
var rec1:iprec;
begin
clientsock.Port:=628;
clientsock.Host:=' 127.0.0.1';
clientsock.active:=true;
end;
procedure Tform1.clientsockConnect(Sender: TObject;
Socket: TCustomWinSocket);
var rec1:iprec;
begin
rec1.clientip:= ip;
rec1.clienthost:=host;
clientsock.open;
clientsock.Socket.SendBuf(rec1,sizeof(rec1));
end;
|
|
Zitat
|