帧格式的组织和发送
var i , x : Integer ;
y :array[0..17] of byte ;
begin
y[0] := $fe ;
y[1] := $fe ;
y[2] := $fe ;
y[3] := $fe ;
y[4] := $68 ;
y[5] := $99 ;
y[6] := $99 ;
y[7] := $99 ;
y[8] := $99 ;
y[9] := $99 ;
y[10] := $99 ;
y[11] := $68 ;
y[12] := $1 ;
y[13] := $2 ;
y[14] := $2e + $33 ;
y[15] := $90 + $33 ;
x := 0 ;
for i := 4 to 15 do
x := x + y[i] ;
y[16] := x mod 256 ;
y[17] := $16 ;
for i := 0 to ChatServerSocket.Socket.ActiveConnections - 1 do
begin
if ChatServerSocket.Socket.Connections[i].RemoteAddress <> clientip.Text then
ChatServerSocket.Socket.Connections[i].SendBuf(y,18) ;
end ;
本文来自博客园,作者:{咏南中间件},转载请注明原文链接:https://www.cnblogs.com/hnxxcxg/archive/2008/10/09/2940806.html