|
|
DataMuseum.dkPresents historical artifacts from the history of: Rational R1000/400 |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about Rational R1000/400 Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - metrics - download
Length: 7168 (0x1c00)
Types: Ada Source
Notes: 03_class, FILE, R1k_Segment, e3_tag, seg_0216eb
└─⟦8527c1e9b⟧ Bits:30000544 8mm tape, Rational 1000, Arrival backup of disks in PAM's R1000
└─⟦5a81ac88f⟧ »Space Info Vol 1«
└─⟦this⟧
SEPARATE (Transport)
PROCEDURE Open_Server (Connection : OUT Transport.Connection_Id;
Status : OUT Transport_Defs.Status_Code;
Network : IN Transport_Defs.Network_Name;
Local_Socket : IN Transport_Defs.Socket_Id) IS
Laddr_In : Socket_System_Interface.Sockaddr_In :=
(Sin_Family => Socket_System_Interface.Af_Inet,
Sin_Port => Unix_Base_Types.Ushort
(Byte_String_To_Integer
(Byte_Defs.Byte_String
(Transport_Defs.Normalize (Local_Socket)))),
Sin_Addr => Socket_System_Interface.Inaddr_Any,
Sin_Zero => (OTHERS => Ascii.Nul));
Laddrlen : Unix_Base_Types.Int := Laddr_In'Size / System.Storage_Unit;
Laddr_In_Ptr : Socket_System_Interface.Sockaddr_In_Ptr :=
To_Sockaddr_In_Ptr (Laddr_In'Address);
New_Connect : Transport.Connection_Id;
Network_Socket : Unix_Base_Types.Int;
System_Call_Result : Unix_Base_Types.Int;
Errno : Unix_Base_Types.Int;
BEGIN
Connection := Null_Connection_Id;
Status := Transport_Defs.Ok;
Start_System_Call;
Network_Socket :=
Socket_System_Interface.Socket
(Af => Unix_Base_Types.Int (Socket_System_Interface.Af_Inet),
Socket_Type => Socket_System_Interface.Sock_Stream,
Protocol => 0);
Errno := Finish_System_Call;
IF (Network_Socket < 0) THEN
Status := Convert_Errno (Errno => Errno);
RETURN;
END IF;
Start_System_Call;
System_Call_Result :=
Socket_System_Interface.Bind
(S => Network_Socket, Addr => Laddr_In_Ptr, Addrlen => Laddrlen);
Errno := Finish_System_Call;
IF (System_Call_Result < 0) THEN
Status := Convert_Errno (Errno => Errno);
Start_System_Call;
System_Call_Result := System_Interface.File_Io.Close (Network_Socket);
Errno := Finish_System_Call;
RETURN;
END IF;
Start_System_Call;
System_Call_Result :=
Socket_System_Interface.Listen (S => Network_Socket, Backlog => 5);
Errno := Finish_System_Call;
IF (System_Call_Result < 0) THEN
Status := Convert_Errno (Errno => Errno);
Start_System_Call;
System_Call_Result := System_Interface.File_Io.Close (Network_Socket);
Errno := Finish_System_Call;
RETURN;
END IF;
-- To reach this point, the Server has been successfully Open, Bound and
-- is Listening. We need to establish a connection_id with the correct
-- information.
New_Connect := Get;
New_Connect.Kind := Server;
New_Connect.Socket_Status := Open;
New_Connect.Local_Socket_Descriptor := Network_Socket;
New_Connect.Tcp_Socket_Descriptor := Unix_Error;
New_Connect.Local_Sockaddr_In := Laddr_In;
-- Tcp_Socket_Descriptor will be set during _accept (Transport.Connect)
Connection := New_Connect;
END Open_Server;
nblk1=6
nid=0
hdr6=c
[0x00] rec0=17 rec1=00 rec2=01 rec3=00c
[0x01] rec0=00 rec1=00 rec2=06 rec3=00e
[0x02] rec0=23 rec1=00 rec2=02 rec3=064
[0x03] rec0=00 rec1=00 rec2=04 rec3=022
[0x04] rec0=1e rec1=00 rec2=05 rec3=034
[0x05] rec0=06 rec1=00 rec2=03 rec3=000
tail 0x215079cc281fb558b743e 0x489e0066482863c01