Home > Back-end >  TCP/IP protocol simulation logic problems
TCP/IP protocol simulation logic problems

Time:09-24

Inquire of some knowledge of the problem, how to simulate a TCP/IP protocol (like/panda betta various live website popularity of virtual simulation software), I want to know is how to simulate a logic and order, and individuals need to have knowledge, almost like this! Please the great god give advice or comments!

Myself with wpe to capture several clear packet try to simulate a few packets, but the simulation results of 10 after a number of connections to the server has refused to connect to me, unless I disconnect before 10 connections can continue, but this time I use web access and can be connected, business sentiment that others have written software is an IP and port connection can have 20 connections, can have a total of 920 connections, and I write my own only have 10 connections, 11 is always rejected the connection!

I wanted to know if I want to write such a software I should how to learn, and logical sequence of the software, such as

To my own code (my own code is from the Internet to find the logic of their write slowly, but the logic is definitely wrong)
IP connection part I put up, the following code is simulated by a part is simulated login, can login but refused to connect a login to 10,
Local even if change the port to connect or unable to connect,

 
Var
RequestStr BackStr: string;
Username: string;
Password: string;
Time: the string;
RoomID: string;
Salt: string;
Uuid: string;
Vitamin k: string;
P: string;
T1, t2: string;
The begin
Username:=';
Password:=';
Time:=IntToStr (DateTimeToUnix (Now) - 8 * 60 * 60);//timestamp
RoomID:=Edit1. Text;//room number
Salt:='7 oe9npeg9xxv69phu31fycluagkeytsf';//unknown values
Uuid: uuidsetup=();//16 hexadecimal random bytes
Vitamin k:=StrToMD5 (time + salt + vitamin k);//unknown values
='type @={p: loginreq/username @=/password @=/roomid @=' + roomid + '/ct @=2/devid @=' + uuid + '/ver @=20150505/rt @=' + time + '/vitamin k @=' + vitamin k + '/'; }
T1:=hextostring (' B8000000B8000000B1020000 ');
T2:=hextostring (' 00 ');
P:=t1 + 'type @=loginreq/+
'username @=' + username +/password @='+ password +'/roompass @=/roomid @='+
RoomID + + uuid '/devid @=' + '/rt @=' + time + + vitamin k + '/vitamin k @=' '/ver @=20150929/ct @=0/' + t2;
//memo1. Lines. The Add (p); }

If the socket. Connected then
The begin
RequestStr:=p;
Try
Socket. Write (RequestStr);//send 1
Memo1. Lines. The Add (' send data: + RequestStr);
T1:=hextostring (f0000001f000000b1020000 '1');
RequestStr:=t1 + 'type @=QRL/rid @=' + RoomID + '/' + t2;
Socket. Write (RequestStr);//send 2

BackStr:=socket. ReadLn (', 1000);//in fact a timeout is ineffective, indy itself
//bug; At this point if the server end to the die such as
Memo1. Lines. The Add (' return data: + BackStr);
Except,
ShowMessage (' send data failed! ');
end;
End
The else
The begin
Memo1. Lines. The Add (' connection has been broken, can't send! ');
end;
end;

CodePudding user response:

Solved? I different IP can only add a total of 10, more not,,,
  • Related