/* The callback function called before the TCP socket was to be destroyed. */
VOID TcpDestroySocketCallback(IN SOCKET *This, IN VOID *Context)
/* The callback function called before the TCP socket was to be destroyed. */
VOID TcpDestroySocketCallback(IN SOCKET *This, IN VOID *Context)
{
  TCP_SERVICE_DATA  *TcpServiceData;
  EFI_GUID          *IpProtocolGuid;
  if (This->IpVersion == IP_VERSION_4) {
    IpProtocolGuid = &gEfiIp4ProtocolGuid;
  } else {
    IpProtocolGuid = &gEfiIp6ProtocolGuid;
  }
  TcpServiceData = ((TCP_PROTO_DATA *)This->ProtoReserved)->TcpService;
  RemoveEntryList (&This->Link);
  gBS->CloseProtocol (
         TcpServiceData->IpIo->ChildHandle,
         IpProtocolGuid,
         TcpServiceData->DriverBindingHandle,
         This->SockHandle
         );
}