From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-lj1-f182.google.com (mail-lj1-f182.google.com [209.85.208.182]) by mx.groups.io with SMTP id smtpd.web08.655.1657736980343773767 for ; Wed, 13 Jul 2022 11:29:40 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20210112 header.b=T4Fi/Nlk; spf=pass (domain: gmail.com, ip: 209.85.208.182, mailfrom: ayushdevel1325@gmail.com) Received: by mail-lj1-f182.google.com with SMTP id c15so14467699ljr.0 for ; Wed, 13 Jul 2022 11:29:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=U7yYeDMfZ23B0XYZ7HebBpWQqeoJ1kOWMjYlGwCPENM=; b=T4Fi/Nlk1u6lNPsjPozEUzd+U/D0sK6hhknHtvKJDukC3U2jWwHx5jdoiQ6k2zVRWb SV2vkSutIvyDJYNAXNJztc5NNf9UYYBD9eSeXhGNflEDWCaAN+UaIZSm834KYzJsLrIz U5QNKhmBhhlKKeUvMq1+0cnv2U55xPqQTozZ65DvrUIWCM2CSXhRx1vwwXW1ujGKNS/b cfAragcu/vxMTK7Pia75Ldd9aSQJ+WLNoO1l2NQ3mgOTjDjn1t+YuGxxD2fxLlYdVlOW Xi2FfYNApe9O/v23fOzXwUH8yuQc0WF6cKMsReelho2FjUDe3FVcjSszrY7Gzysy5xWo gqPg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=U7yYeDMfZ23B0XYZ7HebBpWQqeoJ1kOWMjYlGwCPENM=; b=biSYEa6dW4/WXXuHXT7sBhMb5/JWD8SK1EjGzqVsPX3MG/JBhZE2NzEXg2dVfofFjo 7sjBmw2fvKbDv780c9WF7/mCQvNc/5Eyn0zb5fTFK8wU8TKzCmkC1+udMUHqBM1jtMsr IRkKOzAou+eGgnk4Z/Fx1/IleLpqfHLayRlfoKfhOd0QgYoPnJWiTzCt2PRwWavsQAhC GVyMsuxTSB7n0B4fQu2BIjdJzYP+mdt0qp+ji3zKlxbAvUKP5y2k9MFHJ3Tka+AlNCNG vJr++X/GJ58sllrBd1BhyEOwEFIFFBFlApWWXIWks1/uQtqlmalFuPFaqgZWamGvtr9U 7gnA== X-Gm-Message-State: AJIora9GuniObR0UzipWv7dYCrd0106D7BeYfIltKYtvniAZ5go77gRp zFtwluv3B9fZO+xbkJLj0Oy3aCBr7j6vy61hnPs= X-Google-Smtp-Source: AGRyM1tPwzjBixiprBkvMeTxMLde97evpMjDXUu+aIaSUk/P3xNWxhuIH6/M83OvfHfHn7dnquHUDlVrpUakzs+jtbM= X-Received: by 2002:a05:651c:1502:b0:25d:915d:35bb with SMTP id e2-20020a05651c150200b0025d915d35bbmr1240165ljf.397.1657736978373; Wed, 13 Jul 2022 11:29:38 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: "Ayush Singh" Date: Thu, 14 Jul 2022 00:00:00 +0530 Message-ID: Subject: Re: [NetworkPkg] Clarification on EFI_TCP6_PROTOCOL Destruction Behavior To: "Kinney, Michael D" Cc: "devel@edk2.groups.io" , "mikuback@linux.microsoft.com" , "Gaibusab, Jabeena B" , "Yao, Jiewen" Content-Type: text/plain; charset="UTF-8" Thanks. I'm not sure if I will use it directly, but it gives a very good idea about using these protocols in Rust std. On Wed, Jul 13, 2022 at 11:07 PM Kinney, Michael D wrote: > > It may be simpler to use the following lib class that layers on top of the TCP protocols. > > https://github.com/tianocore/edk2/blob/master/NetworkPkg/Include/Library/TcpIoLib.h > > The implementation of this lib shows the correct sequence: > > https://github.com/tianocore/edk2/blob/master/NetworkPkg/Library/DxeTcpIoLib/DxeTcpIoLib.c > > It uses NetLib services too > > https://github.com/tianocore/edk2/blob/master/NetworkPkg/Library/DxeNetLib/DxeNetLib.c > > Mike > > > > -----Original Message----- > > From: Ayush Singh > > Sent: Wednesday, July 13, 2022 9:45 AM > > To: devel@edk2.groups.io > > Cc: Kinney, Michael D ; mikuback@linux.microsoft.com; Gaibusab, Jabeena B > > ; Yao, Jiewen > > Subject: [NetworkPkg] Clarification on EFI_TCP6_PROTOCOL Destruction Behavior > > > > Hello everyone. I am trying to implement Network Support in Rust std for > > UEFI. While trying to use the TCP6_PROTOCOL, I am not quite sure how to > > deal with destructing the protocol. Since TCP6_PROTOCOL is created using > > a EFI_SERVICE_BINDING_PROTCOL, it should be destroyed using the > > `DestroyChild()` method. However, do I also have to call > > `TCP6_PROTOCOL->Close()` before this or will `DestroyChild()` do that > > implicitly? If I do have to call this method myself, then do I need to > > do `DestroyChild()` in the `CloseToken->Event->NotifyFunction` or is it > > fine to `DestroyChild()` after calling `Close()` (event though `Close` > > is nonblocking) ? > > > > > > Also, it would be great if someone can point me to some TCP Network > > applications. I did find some but most were either drivers, or were very > > simple and did not do any Cleanup stuff. > > > > > > Note: Rust does not need the user to close the connection manually. It > > is closed once the object is dropped (which is done once the object > > owner goes out of scope at compile time). > > > > > > Yours Sincerely > > > > Ayush Singh >