M
menzhe
Unregistered / Unconfirmed
GUEST, unregistred user!
帮我看看到底是哪里出了问题,为什么发不出数据!!!
在另一端用nc监听,可是收不到数据!!!!!我真看不出来哪有问题!
ws : TWSAData;
r:integer;
P:array[0..2]of char;
myaddr:sockaddr_in;
begin
WSAStartup(makeword(2,2),ws);
r:=socket(AF_INET,SOCK_STREAM,IPPROTO_IP);
myaddr.sin_family:=AF_INET;
myaddr.sin_port:=htons(word(5555));
myaddr.sin_addr.S_addr:=inet_addr(pchar('127.0.0.1'));
if connect(r,myaddr,sizeof(sockaddr_in))<>-1 then
begin
p:='am';
send(r,p,2,0)
end;
在另一端用nc监听,可是收不到数据!!!!!我真看不出来哪有问题!
ws : TWSAData;
r:integer;
P:array[0..2]of char;
myaddr:sockaddr_in;
begin
WSAStartup(makeword(2,2),ws);
r:=socket(AF_INET,SOCK_STREAM,IPPROTO_IP);
myaddr.sin_family:=AF_INET;
myaddr.sin_port:=htons(word(5555));
myaddr.sin_addr.S_addr:=inet_addr(pchar('127.0.0.1'));
if connect(r,myaddr,sizeof(sockaddr_in))<>-1 then
begin
p:='am';
send(r,p,2,0)
end;